leiningen

reefersleep 2025-11-06T14:06:10.850409Z

I've made some fairly innocent (in my view) changes on a branch in my work project, and now lein check stalls. It outputs all the same as before, but it hangs before returning the prompt in the terminal. I can't share the code, but I was wondering if there are ways to diagnose lein check stalling?

2025-11-07T15:40:25.713329Z

btw control-\ sends a SIGQUIT (numeric value of 3 on *nix), this can be used with kill and the process PID in scripted situations there's also jstack which is a CLI utility that comes with the vm

Alex Miller (Clojure team) 2025-11-06T14:21:29.808219Z

did you add a use of future?

Alex Miller (Clojure team) 2025-11-06T14:21:52.756099Z

https://clojure.org/guides/faq#agent_shutdown

dpsutton 2025-11-06T14:28:06.055199Z

if this is the case, waiting ~60 seconds should give sufficient time for the program to exit correct?

reefersleep 2025-11-06T14:41:14.138329Z

No futures added (explicitly, anyways)

2025-11-06T14:45:50.830629Z

you can thread dump the JVM to see what are the threads doing, with VisualVM or jstack (which comes with the JDK). Maybe it can throw some light. Run jps to determine the PID of the JVM running that lein check and then jstack PID

reefersleep 2025-11-06T14:52:01.294509Z

@jpmonettas I'll give it a go 🤓

dpsutton 2025-11-06T14:52:20.950139Z

did you give it a few minutes after it started stalling?

reefersleep 2025-11-06T14:53:24.594819Z

For narrowing down the problem, I'm doing the changes in the PR stepwise until it fails, but knowing how to diagnose it generally would be handy

reefersleep 2025-11-06T14:53:40.205149Z

@dpsutton hours 😅

👍 1
dpsutton 2025-11-06T14:54:15.292699Z

> When a program like this finishes, there will be a 60 second pause before exit. To fix this problem, call https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/shutdown-agents as the program exits. That means we can exclude this issue then

reefersleep 2025-11-06T14:58:07.585529Z

I think so 🤓

reefersleep 2025-11-06T14:59:01.417139Z

I'll give an update when I've narrowed down the offending code. It's really not that much code, but the stepwise checks are taking quite some time.

dpsutton 2025-11-06T15:00:00.085479Z

if you hit control-\ you will get a stack dump and it will most likely point directly to whatever is holding up the exit

💯 1
dpsutton 2025-11-06T15:00:38.322999Z

you might still end up looking through code but that would at the very least provide a map