clojure-emacs / clojure-emacs/logjam
Don't let client slowness possibly block JVM threads
- Dominant language
- Clojure
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Context
As discussed in https://github.com/clojure-emacs/cider-nrepl/pull/773#discussion_r1227086600, 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:
```clj
(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.
Contributor guide
Assessment
This issue has not been assessed yet.