Skip to content

Conversation

@stevendanna
Copy link

Description

If the supervise/ok pipe already exists on disk before runsv has
started, then existence check here is not enough.

Since runsv opens the pipe for reading as part of its startup, we can
open it for writing which will block until runsv has called open.

A version of this fix has been running in one of our internal projects
for some time.

Check List


# Opening the pipe for writing should block until the supervisor
# has opened it for reading.
::File.open(path, "w").close()
Copy link
Author

@stevendanna stevendanna Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This technically means that the user running chef-client now needs write permission on these pipes. If we are worried about that, we could rescue Errno::EACCES which is no worse than the old behavior.

If the supervise/ok pipe already exists on disk before runsv has
started, then existence check here is not enough.

Since runsv opens the pipe for reading as part of its startup, we can
open it for writing which will block until runsv has called open.

A version of this fix has been running in one of our internal projects
for some time.

Signed-off-by: Steven Danna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants