Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait until runsv is reading from supervise/ok #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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