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

Don't let client slowness possibly block JVM threads #4

Open
vemv opened this issue Jun 19, 2023 · 1 comment
Open

Don't let client slowness possibly block JVM threads #4

vemv opened this issue Jun 19, 2023 · 1 comment

Comments

@vemv
Copy link
Member

vemv commented Jun 19, 2023

Context

As discussed in clojure-emacs/cider-nrepl#773 (comment), it seems possible that given a slow- or buggy-enough client, sending logs from the JVM would actually block the given JVM thread that is performing the logging.

i.e., clojure code like:

(log/error :foo)

might block if Emacs happens to have some sort of issue. Which doesn't seem incredibly rare given Emacs' customizability.

Proposed solution

Make sure that the actual logging call happens from a thread executor. One communicates with said thread by message passing. One can check whether the thread is alive by using e.g. deref with its [ref timeout-ms timeout-val] extended signature.

And one could have a nrepl command for "resetting" the executor to a new one, which would help if it ever got stuck.

@vemv
Copy link
Member Author

vemv commented Jun 19, 2023

@r0man: this issue is kind of hypothetical, however it should be easy to check by intentionally blocking emacs with a M-: (while 1), and then trying to log from a repl in iTerm.

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

No branches or pull requests

1 participant