-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Create isclosing and isclosed methods #53426
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
base: master
Are you sure you want to change the base?
Conversation
|
That is not what is happening in #53392 though, which is a definite libuv bug which will not be in any way benefited by these methods, which appears to be caused by a known limitation with epoll's implementation in the linux kernel (we can work around this in libuv as the epoll implementation issue is documented) |
|
isn't |
|
@vtjnash I agree that this has no direct impact on the issue uncovered by JuliaDebug/Cthulhu.jl#541. The primary cause is within libuv as you describe. Independent of that issue it is not clear to me there why the REPL should fail in that julia/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl Lines 238 to 250 in 4ac32e9
In #53392 I proposed that we catch the specific error thrown by in_stream = pipe_reader(term)
if isopen(in_stream) && in_stream.status != Base.StatusClosing
# call method that throws if in_stream is closed or closing.
endRather than access the field directly, I thought there should be an API such that one could do the following.
@quinnj Here is the definition of Lines 379 to 384 in 02699bb
Checking for the closed state seems much simpler. We only need to do |
In #53392, I noticed a missing API call to check if a stream had a state of
Base.StatusClosing.A stream acquires a state of
Base.StatusClosingafter one usesclose(stream).A stream acquires the state of
Base.StatusClosedonce libuv calls back into Julia to confirmthe closed state.
To avoid the implementation details of how an IO stream's state from leaking out of base, I
propose we add
Base.isclosingandBase.isclosedmethods.