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

Implement message interrupt mode #804

Merged
merged 1 commit into from
Feb 11, 2019
Merged

Conversation

filmor
Copy link
Contributor

@filmor filmor commented Jan 31, 2019

Fixes #503.

This switches entirely over to message mode. We can either make this configurable (though it must be set for Windows) or remove the signal mode completely.

/EDIT: After adjusting to the PR comments, message mode is only used on Windows.

src/eventloop.jl Outdated Show resolved Hide resolved
deps/kspec.jl Outdated Show resolved Hide resolved
@stevengj
Copy link
Member

stevengj commented Feb 1, 2019

I'm confused about how this is supposed to work. If an execute_request is being handled, then in our current implementation the eventloop will be hung until that completes, so it will never get the interrupt_request, no?

@filmor
Copy link
Contributor Author

filmor commented Feb 1, 2019

The message comes in via the control socket which is separate from the normal shell socket that gets the messages for execute, complete and other "normal" requests. Kernels are supposed to prioritise messages on the control socket.

@stevengj
Copy link
Member

stevengj commented Feb 1, 2019

Oh, I missed that — yes, we handle the control socket in a separate asynchronous task, so that should be fine.

In the current Julia release, tasks are scheduled cooperatively, so the execution task may be hogging all of the cycles if it refuses to yield (or do something like I/O that implicitly yields), in which case this still won't work. But in a future Julia release the tasks will be able to run in separate threads (JuliaLang/julia#22631).

@filmor
Copy link
Contributor Author

filmor commented Feb 1, 2019

I guess this is still the best we can do for Windows :). It works reliably (on both Windows and Linux) for a simple sleep, I haven't tried it yet with actual load.

@stevengj
Copy link
Member

stevengj commented Feb 1, 2019

(sleep lets other tasks run.)

deps/kspec.jl Show resolved Hide resolved
Default to message mode for Windows and keep the previous behaviour for
all other platforms.
@filmor
Copy link
Contributor Author

filmor commented Feb 11, 2019

Is there anything missing?

@stevengj stevengj merged commit 604c9a7 into JuliaLang:master Feb 11, 2019
@stevengj
Copy link
Member

Thanks!

@carstenbauer
Copy link
Member

Great to see this fixed! @stevengj, is this worth tagging a release?

@stevengj
Copy link
Member

Tagged 1.17.0

@filmor filmor deleted the interrupt branch March 8, 2021 13:39
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.

3 participants