-
Notifications
You must be signed in to change notification settings - Fork 413
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(rpc): remove threads #7418
fix(rpc): remove threads #7418
Conversation
9ae747d
to
bf1b254
Compare
51abe86
to
46f9124
Compare
ping @nojb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to review this, but I have some general questions:
- What is the motivation for this change? In other words, what is the main expected benefit of the changes in this PR with respect to the existing code?
- The doc mentions that pipes are used on Unix. They are not used on Windows? Is something else used instead?
There's a couple of benefits:
Where does it mention that? I think we switched to sockets everywhere to simplify the implementation. |
Here: and here: |
Oh yeah that's a single pipe I use to be able to interrupt the select. I'm using non-blocking pipes only on Unix - that's what I meant. |
46f9124
to
583dd8f
Compare
Some additional notes:
|
583dd8f
to
d567a19
Compare
d567a19
to
902838a
Compare
A few remarks after glancing at the code. Probably not useful, but just in case:
|
Thanks, all good points. Not sure about the second point (I have forgotten some of the details); I'll take a closer look and report back. And I'll prepare a PR with the fixes. |
498b37e
to
4e571b7
Compare
Argh, while investigating the Windows issue I realized that the bad behaviour is already present in |
replace them with evented io based on Unix.select Signed-off-by: Rudi Grinberg <me@rgrinberg.com> <!-- ps-id: 2d55627f-c73c-41a0-8e41-e57482f0edbe -->
4e571b7
to
2647cd1
Compare
You can try bisecting. I can't think of anything that is Windows specific. By the way, I discovered some issues with this PR and I've updated it to fix them. Nothing is windows specific, but perhaps windows fails in some special way. So perhaps it's worth trying this PR again. |
Hmm, that's quite weird. I would assume tui does nothing if it's not enabled. |
There were a few changes for tui (in a different PR) to improve how signals were handled. We'll have to see what went wrong. I have a windows vm so I can also take a closer look. |
It seems to be related to the replacement of
by
|
For a quick fix, how about we go back to the unthreaded console for windows. Should be quite easy. |
I don't understand: the current code uses |
I think I confused myself with all these UI switches we've had :) Looking at the current state, I see that our progress reporting does not rely on an additional thread. I don't know why, but my intention was that it would. From the diff you've pointed out, switching from threaded to unthreaded introduced an issue. I have no idea why, but it's worth it to toggle it back to threaded to see if you can get the bug to go away. |
I tried, but then the progress line completely disappeared, and the system did not appear very responsive... Not sure if it is an issue on Windows only or if it affects Linux as well; I'll try to investigate more later. |
In any case, I think we're convinced this PR doesn't introduce this problem. Since it also fixes a serious issue with RPC, I'm merging. |
replace them with evented io based on Unix.select Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
replace them with evented io based on Unix.select Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
replace them with evented io based on Unix.select Signed-off-by: Rudi Grinberg <me@rgrinberg.com> Signed-off-by: Etienne Millon <me@emillon.org>
CHANGES: - Switch back to threaded console for all systems; fix unresponsive console on Windows (ocaml/dune#7906, @nojb) - Respect `-p` / `--only-packages` for `melange.emit` artifacts (ocaml/dune#7849, @anmonteiro) - Fix scanning of Coq installed files (@ejgallego, reported by @palmskog, ocaml/dune#7895 , fixes ocaml/dune#7893) - Fix RPC buffer corruption issues due to multi threading. This issue was only reproducible with large RPC payloads (ocaml/dune#7418) - Fix printing errors from excerpts whenever character offsets span multiple lines (ocaml/dune#7950, fixes ocaml/dune#7905, @rgrinberg)
replace them with evented io based on Unix.select
Signed-off-by: Rudi Grinberg me@rgrinberg.com