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

middleware.out may stop working after a reconnect? #878

Open
vemv opened this issue May 21, 2024 · 10 comments
Open

middleware.out may stop working after a reconnect? #878

vemv opened this issue May 21, 2024 · 10 comments

Comments

@vemv
Copy link
Member

vemv commented May 21, 2024

I'm using CIDER 1.13.1 (Santiago) and log4j2 (deps.edn) and my CIDER session disconnected because it lost access to the network. Is there any way to get the repl buffer reattached to the log output?

https://clojurians.slack.com/archives/C0617A8PQ/p1716294437574019

This happens after a reconnection via cider-connect .

@vemv
Copy link
Member Author

vemv commented May 21, 2024

It might be similar to clojure-emacs/logjam#16 (easy fix)

@timvisher
Copy link

I'll see if I can produce a minimal repro case.

@timvisher
Copy link

👋 👋 👋 @vemv. This is decently minimal. Hope it helps. :)

https://github.com/timvisher/cider-middleware-out-repro-issue-878

@vemv
Copy link
Member Author

vemv commented May 22, 2024

Thanks, Tim!

Hope we can jump to it one of these days.

@timvisher
Copy link

I was able to reproduce this using logback as well which is documented as working in the manual. It's up in https://github.com/timvisher/cider-middleware-out-repro-issue-878 (commit). Cheers! :)

@vemv
Copy link
Member Author

vemv commented Jun 5, 2024

Thanks!

Just as additional context, why do you need to reconnect with a certain frequency?

It seems fairly unusual to me to have a repl connection dropped.

@timvisher
Copy link

I'm connecting from my laptop which sleeps and wakes with some regularity. The process I'm running takes days to complete (currently) and I want to be monitoring its progress while doing other things.

Make sense? It's a bit of strange use case even in my career but doesn't seem wildly undesirable.

@timvisher
Copy link

I've observed that any logs that are created after reconnect do get captured in the REPL buffer. And if I use a future to manage the long running process then I can cancel it and recreate it and new logs are captured. This is less than ideal obviously but an interesting data point. This is all in the repro repo.

@vemv
Copy link
Member Author

vemv commented Jun 6, 2024

Thanks!

The process I'm running takes days to complete (currently) and I want to be monitoring its progress while doing other things.

In case it helps, for anything that is production-like, we don't particularly recommend having the cider-nrepl middleware stack activated.

(It's perfectly possible to have a bare nREPL server running, without cider-nrepl, and have a CIDER connected to it. It will have a more bare-bones functionality)

The reason is that cider-nrepl is generally aimed for dev-time activities and its side-effects are not guaranteed to not intefere with production matters.

With all this said, we should certainly aim to fix these. Personally I can't exactly promise when - PRs welcome as well.

@timvisher
Copy link

The process I'm running takes days to complete (currently) and I want to be monitoring its progress while doing other things.

In case it helps, for anything that is production-like, we don't particularly recommend having the cider-nrepl middleware stack activated.

(It's perfectly possible to have a bare nREPL server running, without cider-nrepl, and have a CIDER connected to it. It will have a more bare-bones functionality)

The reason is that cider-nrepl is generally aimed for dev-time activities and its side-effects are not guaranteed to not intefere with production matters.

With all this said, we should certainly aim to fix these. Personally I can't exactly promise when - PRs welcome as well.

Very much understood. :)

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

2 participants