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

refresh ops shouldn't have a timeout #3652

Closed
vemv opened this issue May 2, 2024 · 3 comments · Fixed by clojure-emacs/cider-nrepl#873
Closed

refresh ops shouldn't have a timeout #3652

vemv opened this issue May 2, 2024 · 3 comments · Fixed by clojure-emacs/cider-nrepl#873

Comments

@vemv
Copy link
Member

vemv commented May 2, 2024

nrepl-send-sync-request: Sync nREPL request timed out (op refresh-clear) after 10 secs

Messages such as these don't make much sense to me. Code reloading can take arbitrarily long.

Timing out can invite the user to try again while code reloading is already in progress (thankfully we have locking in place, but still leads to unnecessary queueing)

I'd say that for these ops in particular, we could have a timeout of about 3 minutes?

@bbatsov
Copy link
Member

bbatsov commented May 2, 2024 via email

@vemv
Copy link
Member Author

vemv commented May 2, 2024

I see things differently - many commercial-sized projects can easily need 30s+ for a full-blown refresh.

Also, users don't necessarily are familar with (or even will pay much attention to) "nrepl timeouts".

Test suite running is similarly unbounded?

@vemv
Copy link
Member Author

vemv commented May 2, 2024

A touch more of tech analysis:

  • refreshing is generally async
  • however, refresh-clear is sync
  • both grab a lock, cider-nrepl side
  • so, while refresh-clear itself is fast (it doesn't do code reloading per se), it first has to grab a lock, which may be held by an in-progress code reloading (triggered async)

A very cool alternative approach would be to remove the locking from https://github.com/clojure-emacs/cider-nrepl/blob/79611e47615bc00ea00fe9c265da896976324ae0/src/cider/nrepl/middleware/refresh.clj#L110 , refactoring it to merely enqueue a clearing. So next time refresh-reply is hit, it checks the queue, and performs a clearing if due.

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 a pull request may close this issue.

2 participants