Bug 1479834

Summary: Multiple ptp4l use same /var/run/ptp4l
Product: Red Hat Enterprise Linux 7 Reporter: Beat Rubischon <brubisch>
Component: linuxptpAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED WONTFIX QA Contact: Qiao Zhao <qzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: thozza, xiawu
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-17 09:09:53 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:
Bug Depends On:    
Bug Blocks: 1549614    

Description Beat Rubischon 2017-08-09 13:59:28 UTC
Description of problem:

ptp4l uses the socket /var/run/ptp4l to communicate with the management tool pmc and to deliver an up to date interface list to phc2sys. Multiple ptp4l by intention or by mistake will use the same socket.

Killing one of those ptp4l processes would remove the socket, phc2sys won't be able to synchronize any longer due to the lack of communication with ptp4l.

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

Tested on

linuxptp-1.4-3.20140718gitbdb6a3.el7.x86_64
linuxptp-1.7.1.fc25.x86_64
linuxptp-1.8-3.el7.x86_64

How reproducible:

always

Steps to Reproduce:
1. Install linuxptp
2. Run "ptp4l -i enp0s25 -m"
3. Run "phc2sys -a -m"
4. Run "ptp4l -i enp0s25 -m"
5. Stop second instance of ptp4l

Actual results:

phc2sys will stop synchronizing time, complaining...

phc2sys[3829328.174]: uds: sendto failed: No such file or directory
phc2sys[3829328.174]: uds: sendto failed: No such file or directory
phc2sys[3829329.174]: uds: sendto failed: No such file or directory

Expected results:

phc2sys will continue synchronizing time

Additional info:

phc2sys requires bare metal system with an PTP capable NIC.

It's unclear to me if and when how we could change the current behavior. In multiple ptp4l setups the phc2sys process is usually configured manually, still we have an issue in cases where a second ptp4l was started "to check the functionality" and killed afterwards. Leaving the socket in place might be an option, but requires further testing.

Comment 2 Miroslav Lichvar 2017-08-10 11:09:27 UTC
I think one way to solve this would be to modify ptp4l to not try to remove the socket on start. If binding to the socket fails, ptp4l will work without the UDS transport, or perhaps it could be handled as a fatal error.

The question is if it would be acceptable behavior in case the socket was left there due to ptp4l terminating in an abnormal way (e.g. crash). The user would have to manually remove the socket in order to get phc2sys working. It will change the user experience.

Comment 3 Miroslav Lichvar 2017-10-12 07:27:18 UTC
FWIW, an RFC patch was posted for this on the upstream list

https://www.mail-archive.com/linuxptp-devel@lists.sourceforge.net/msg02103.html

Comment 4 Miroslav Lichvar 2018-03-22 11:05:04 UTC
As this would change the behavior of ptp4l in case of an existing socket (from existing or crashed ptp4l instance), I think it would rather be a candidate for the next major RHEL release instead of minor release.

Comment 8 Red Hat Bugzilla Rules Engine 2018-05-17 09:09:53 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.