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

fix IO deadlock condition #22886

Merged
merged 1 commit into from
Jul 28, 2017
Merged

fix IO deadlock condition #22886

merged 1 commit into from
Jul 28, 2017

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jul 20, 2017

when calling uv_shutdown on a handle being written to by another process
we might never get the UV__POLLOUT notification
but we also don't need to delay the uv_close call
if we have nothing to write

in the future, we should introduce a new uv_drain callback,
instead of continuing to abuse uv_shutdown for this purpose

fix #22832

src/jl_uv.c Outdated
// attempt graceful shutdown of writable streams to give them a chance to flush first
// TODO: introduce a uv_drain cb API instead instead of abusing uv_shutdown in this way
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicated "instead"

test/spawn.jl Outdated
sleep(0.5) # give cat a chance to fill the write buffer for stdout
close(stdout.in) # make sure we can still close the write end
@test sizeof(readstring(stdout)) == 1048576 * 2 # make sure we get all the data
success(p)
Copy link
Contributor

Choose a reason for hiding this comment

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

@test ?

@kshyatt kshyatt added the io Involving the I/O subsystem: libuv, read, write, etc. label Jul 20, 2017
when calling uv_shutdown on a handle being written to by another process
we might never get the UV__POLLOUT notification
but we also don't need to delay the uv_close call
if we have nothing to write

in the future, we should introduce a new `uv_drain` callback,
instead of continuing to abuse uv_shutdown for this purpose

fix #22832
@@ -469,3 +479,19 @@ let c = `ls -l "foo bar"`
@test length(c) == 3
@test eachindex(c) == 1:3
end

## Deadlock in spawning a cmd (#22832)
# FIXME?
Copy link
Contributor

Choose a reason for hiding this comment

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

what was broken about this? use test_broken

Copy link
Contributor

@tkelman tkelman Jul 28, 2017

Choose a reason for hiding this comment

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

hello?

PLEASE communicate more here. No one can read your mind. What didn't work about this, a FIXME comment with no details and a commented out test is better than nothing, but doesn't actually help anyone figure out what is wrong here and why the test doesn't work, can't use @test_broken, or the fix is incomplete. You do this over and over and over again and I implore you every time to cut it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mentioned in the merge commit text. I don't know the answers to any of those questions, so I can't provide more information. If I knew any of those answers, I would have already fixed the test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would test_broken have worked? A simple response to the question "it froze on CI and couldn't reproduce locally" would be a lot more visible than the merge commit text.

visr added a commit to visr/LasIO.jl that referenced this pull request Jul 26, 2017
…n't dead lock. Ugly workaround."

This reverts commit 2a5c158.

Issue
JuliaLang/julia#22832
is fixed with
JuliaLang/julia#22886
@vtjnash vtjnash merged commit 930a5f0 into master Jul 28, 2017
@vtjnash vtjnash deleted the jn/io-deadlock branch July 28, 2017 00:53
@tkelman tkelman self-assigned this Jul 28, 2017
@tkelman tkelman added the needs tests Unit tests are required for this change label Jul 28, 2017
@tkelman tkelman removed their assignment Jul 28, 2017
visr added a commit to visr/LasIO.jl that referenced this pull request Aug 2, 2017
…n't dead lock. Ugly workaround."

This reverts commit 2a5c158.

Issue
JuliaLang/julia#22832
is fixed with
JuliaLang/julia#22886
tkelman added a commit to tkelman/METADATA.jl that referenced this pull request Aug 8, 2017
so it doesn't get used on versions of Julia susceptible to
JuliaLang/julia#22886
tkelman added a commit to JuliaLang/METADATA.jl that referenced this pull request Aug 9, 2017
so it doesn't get used on versions of Julia susceptible to
JuliaLang/julia#22886
visr added a commit to visr/LasIO.jl that referenced this pull request Aug 17, 2017
…n't dead lock. Ugly workaround."

This reverts commit 2a5c158.

Issue
JuliaLang/julia#22832
is fixed with
JuliaLang/julia#22886
ararslan pushed a commit that referenced this pull request Sep 11, 2017
fix an IO deadlock condition (#22832)

disabled test seems to indicate this doesn't fix it fully, but it seems that only reproduces on CI, not on any of my local machines

Ref #22886
(cherry picked from commit 930a5f0)
@evetion evetion mentioned this pull request Jun 29, 2018
3 tasks
ararslan pushed a commit that referenced this pull request Jul 2, 2018
when calling uv_shutdown on a handle being written to by another process
we might never get the UV__POLLOUT notification
but we also don't need to delay the uv_close call
if we have nothing to write

in the future, we should introduce a new `uv_drain` callback,
instead of continuing to abuse uv_shutdown for this purpose

fix #22832

Ref #22886
(cherry picked from commit 8949a95)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc. needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock in reading stdout from cmd
3 participants