What would cause a Clojure program to not immediately exit upon finishing the last statement in the main function?
All I did was to change a (doall (map ...))<
pmap
will spin up multiple threads from a threadpool to service your concurrent tasks.
Calling shutdown-agents is necessary to allow the JVM to exit in an orderly manner because the threads in the agent threadpools are not daemon threads.
You need to explicitly tell them to gracefully shutdown (but only when your program is done). This looks to have been answered before here.
Quoting from that answer:
"You need to call shutdown-agents
to kill the threads backing the threadpool used by pmap."
Docs are here: http://clojuredocs.org/clojure_core/1.3.0/clojure.core/shutdown-agents