Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1812184

Summary: fixes to connection handling and client debugging
Product: Red Hat Enterprise Linux 8 Reporter: David Teigland <teigland>
Component: sanlockAssignee: David Teigland <teigland>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: agk, cluster-maint, cmarthal, nsoffer, rhandlin
Target Milestone: rcKeywords: Rebase
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sanlock-3.8.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:14:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Teigland 2020-03-10 17:45:11 UTC
Description of problem:

While debugging bug 1664159, a few other fixes related to client connection handling were added, in addition to the new debugging capabilties that were added to find the problem.  This bug covers those other fixes and improvements,
and since these are the only sanlock changes upstream we can take them all with a rebase.


commit 4c3924eb226d345cfc2da3baa81c68566f2c8bbb
Author: David Teigland <teigland>
Date:   Mon Mar 9 14:52:03 2020 -0500

    sanlock: clear revents in client_free
    
    By clearing poll revents sanlock won't receive
    or process anything more from the client.
    After calling client_free() from the main loop,
    we will not have to process a poll error for
    that client and call client_free() again.

commit b9cd4651a738bab65102fdc50c7067080dd5ce45
Author: David Teigland <teigland>
Date:   Tue Mar 10 12:20:27 2020 -0500

    sanlock: per command debug logging
    
    Allow debugging logging for specific commands to be
    enabled or disabled at the command processing level.
    
    In sanlock.conf:
    
    debug_cmd = +<name>
    enables cmd level debugging for the named command.
    
    debug_cmd = -<name>
    disables cmd level debugging for the named command.
    
    debug_cmd lines can be repeated, once for each name.
    
    By default sanlock disables some cmds that are often
    repetitive and fill the in-memory debug buffer.

commit f9b09264a4857afc5b10db8b0f157676848de926
Author: David Teigland <teigland>
Date:   Mon Mar 9 15:56:05 2020 -0500

    sanlock: client debug logging
    
    New debug logging for client connections, enabled with
    debug_clients=1 in sanlock.conf.

commit d384a9cbc278756523ae59dd12131df78859a518
Author: David Teigland <teigland>
Date:   Mon Mar 9 15:21:35 2020 -0500

    sanlock: clean up poll event checks for efd
    
    Never look at clients array when checking efd.
    (No evidence of any problems from this.)

commit fd5ec4c01b4796abe9153aa45b2c26fbacc1ab2a
Author: David Teigland <teigland>
Date:   Mon Mar 9 12:34:54 2020 -0500

    sanlock: fix connection processing error path
    
    Don't close the connection fd in process_cmd_thread_unregistered
    error path, avoiding possible problems like that fixed in
    62ba5d194100f71cbed32214e0aeb76f690f4093.
    Handle it like process_cmd_thread_registered by receiving any
    data, sending an error back to the client, and resume the client.
    
    Call client_free() in the following cases to close
    the client connection instead of doing nothing and
    waiting for a poll error on the connection to clean
    it up later:
    - when recv() returns zero
    - when client_suspend() finds an error
    - when receiving an unknown cmd
    
    These error paths are not exercised by normal usage.




Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Nir Soffer 2020-05-01 22:43:07 UTC
David, since all these fixes are merge, should this be POST or MODIFIED?

Comment 2 David Teigland 2020-05-05 19:37:55 UTC
We need qa flag set, this has been done by RHV and/or LVM QE in the past.

Comment 7 Corey Marthaler 2020-09-22 15:34:37 UTC
Marking this rebase bug verified based on latest sanlock + lvmlockd regression testing.

sanlock-3.8.2-1.el8    BUILT: Mon Aug 10 12:12:49 CDT 2020
sanlock-lib-3.8.2-1.el8    BUILT: Mon Aug 10 12:12:49 CDT 2020

kernel-4.18.0-235.el8    BUILT: Thu Sep  3 13:19:50 CDT 2020
lvm2-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
lvm2-lockd-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020

Comment 10 errata-xmlrpc 2020-11-04 02:14:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sanlock bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4595