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

`lein repl` times out with no useful error message when using `clojure.java.shell/sh` in user.clj #2490

Closed
teodorlu opened this issue Nov 29, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@teodorlu
Copy link

commented Nov 29, 2018

Hello!

I spent a lot of time debugging yesterday, and thought I'd report what I experienced.

Steps to reproduce

  1. Create a new project: lein new sh-timeout

  2. Modify src/user.clj to the following:

    (ns user
      (:require
       [clojure.java.shell :refer [sh]]))
    
    (sh "echo" "infinite timeout!")
  3. Run lein repl

Observed behavior

  1. Wait for about a minute with no message
  2. Observe REPL server launch timed out. printed to the REPL
  3. Leiningen exits with code 1

Expected behavior

  • Repl launched
  • or a related error message

Self criticism

Running shell commands automatically when the REPL is launched can cause unexpected consequences.

@technomancy

This comment has been minimized.

Copy link
Owner

commented Nov 29, 2018

Unfortunately the automatic loading of user.clj is a feature controlled by Clojure, not something Leiningen can affect. The fact that sh blocks forever in this case is also a problem with Clojure itself. Putting any code that blocks forever in user.clj will cause this problem but it's unfortunately not something that can be fixed within Leiningen.

@teodorlu

This comment has been minimized.

Copy link
Author

commented Nov 30, 2018

Thanks for the quick response. I can reproduce with clj, so this isn't just a problem for leiningen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.