From nobody Thu Sep 19 01:28:06 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8Hvp1DV7z5Vc6Q for ; Thu, 19 Sep 2024 01:28:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8Hvn6BWsz4JpN for ; Thu, 19 Sep 2024 01:28:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726709285; a=rsa-sha256; cv=none; b=Xu8SwM+CVYj5A3P0SalA53M5A/FGJ5Ftw0qnEodvOFwzIoZKXShCMbxoTbcrPJaqIqULWN DDtDEuw6BbRnUsGKsSU3v1NqjdB4oqiJTs5brnbfFrOYApC1P2H45ZiJecmW1hEo0lBb5s czBQkIRiTkrNlKL+1Xg2QR83gOK+Yf6nFCiVNopVnj8kF6Ffzb+oK5eAa+JoPehqHqm8Tx mKltdVE6eBkcjKoFZpED6uCmW5uctMIrWyYro7+NBo8YslIBSy1lHP+MC4PtfVnHvdAjsb f2UFZcnV4ic7H5rDhg63LsT9xPr5nx8l2A881h+KpcXANvBEljtS22i0F4X1Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726709285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NQjZ32bNjOdsSo0U5f61Fmlm8uukB/c/wuaQ0JrnLOs=; b=BqDFG5QQkaGZhTMWPh/McSBS+/tLH4qySACmxz3rFcnL0oFo3ecxLE3AeczLOlxcTcVGq9 hTXmIhskAG9DjCvQeQr2F5iPD2ySp0oEFZRhGyVbbrK8VtZxpzeQTdpfowYjCraJQtmXDl LbhHqp6+tSN7NMCwIkLIigS+rhO2Aa67nRpYrYLv6wUsAq4jeP0Jh367wN+MLI2Rest7lT x19+fivLDCuXt9VfWT9E4VY28nagXI9f8BS3z8fnkGchsuugtZSG2IJXicj/ke8f+5fdM9 f2UMuLKTZihkSW24+LHewdH+CN95tIw2tNcGp/kK6cfYiYKDty/hT0c/yIj/Ag== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8Hvn5k9zzlx5 for ; Thu, 19 Sep 2024 01:28:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 48J1S57g001403 for ; Thu, 19 Sep 2024 01:28:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 48J1S5j7001402 for bugs@FreeBSD.org; Thu, 19 Sep 2024 01:28:05 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271460] ctld ports become inaccessible due to concurrent service restarts Date: Thu, 19 Sep 2024 01:28:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271460 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D5f89aea7b74aa4605b25af62e31303097= a4a48cc commit 5f89aea7b74aa4605b25af62e31303097a4a48cc Author: Alan Somers AuthorDate: 2024-08-07 15:21:08 +0000 Commit: Alan Somers CommitDate: 2024-09-18 20:06:31 +0000 ctld: fix several process setup/teardown bugs All of the below bugs could result in a system where ctld is not running, but LUNs and targets still exist in the kernel; a difficult situation to recover from. * open the pidfile earlier. Open the pidfile before reading the kernel's current state, so two racing ctld processes won't step on each others' toes. * close the pidfile later. Close it after tearing down the configuration, for the same reason. * If the configured pidfile changes, then rename it on SIGHUP rather than remove and recreate it. * When running in debug mode, don't close the pidfile while handling a new connection. Only do that in non-debug mode, in the child of the fork. * Register signal handlers earlier. Otherwise a SIGTERM signal received during startup could kill ctld without tearing down the configuration. MFC after: 2 weeks PR: 271460 Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1370 usr.sbin/ctld/ctld.c | 70 ++++++++++++++++++++++++++++++------------------= ---- 1 file changed, 40 insertions(+), 30 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=