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

Long delay after building #171

Closed
yayitswei opened this issue Jan 11, 2013 · 10 comments
Closed

Long delay after building #171

yayitswei opened this issue Jan 11, 2013 · 10 comments
Milestone

Comments

@yayitswei
Copy link

When I run lein cljsbuild once, the process prints "Successfully compiled ... in 6.727668 seconds." and then waits a long time (about 30s on my machine) before returning. This means that lein cljsbuild test takes over a minute to run. What is the build process doing during that time?

@yayitswei
Copy link
Author

I'm using [lein-cljsbuild "0.2.10"].

@magomimmo
Copy link
Contributor

I had the same problem with 0.2.10. I did as follows

$ cd a-cljs-project
$ lein cljsbuild clean
$ lein clean
$ rm -rf ~/.m2/
$ lein cljsbuild once

and the hanging disappeared

mimmo

On Jan 11, 2013, at 11:52 AM, Wei Hsu wrote:

I'm using [lein-cljsbuild "0.2.10"].


Reply to this email directly or view it on GitHub.

@yayitswei
Copy link
Author

That didn't fix it for me. Wonder if it's related to a particular dependency. Here's my project.clj:

https://gist.github.com/4510207

@magomimmo
Copy link
Contributor

and this is the project against which I tested lein-cljsbuild 0.2.10

https://github.com/magomimmo/modern-cljs.git

HIH to check if it's a dependency related issue

mimmo

On Jan 11, 2013, at 1:02 PM, Wei Hsu wrote:

That didn't fix it for me. Wonder if it's related to a particular dependency. Here's my project.clj:

https://gist.github.com/4510207


Reply to this email directly or view it on GitHub.

@magomimmo
Copy link
Contributor

the same delay issue have been experienced again by me just by substituting domina 1.0.0 with 1.0.2-SNAPSHOT in my project dependencies.

@emezeske
Copy link
Owner

I don't think this is dependency-related -- I think it has to do with how Leiningen is pumping input/output to the process. Here is a stack trace of lein cljsbuild once while it's in the hung state:

https://gist.github.com/4582693

@emezeske
Copy link
Owner

Issue #147 might have a hint as to the source of this problem:

technomancy/leiningen@ecdc783

Based on that commit and the stack trace, I think this is somehow related to input pumping in Leiningen's sh function.

@emezeske
Copy link
Owner

This commit has a hack that seems to fix this problem (but I don't fully understand why):

d836402

@yayitswei
Copy link
Author

Thanks for addressing this Evan! Your solution might shed light on another hanging problem in one of my own projects.

@emezeske
Copy link
Owner

Sure thing. My solution is definitely a hack -- it works for me but I don't totally understand it. Hopefully it works for everyone...

sfnelson pushed a commit to montoux/lein-cljsbuild that referenced this issue Apr 13, 2017
address emezeske#171. This caused a regression in testing and notify behaviour that was
reported as emezeske#453, where subprocesses would hang for 30 seconds after the
subprocess completed.

This commit avoids the need for pump threads to copy data from subprocess
streams by using ProcessBuilder's existing Redirect functionality to either
write redirect stream output to files directly, or to inherit System.out and
System.err from the main process. This means that `lein test` etc now terminate
in a reasonable time again, and avoids the call to `exit` that was causing
problems for trampoline tasks.
sfnelson pushed a commit to montoux/lein-cljsbuild that referenced this issue Apr 13, 2017
Pull request emezeske#436 removes the call to exit that was added to address emezeske#171. This
caused a regression in testing and notify behaviour that was reported as emezeske#453,
where subprocesses would hang for 30 seconds after the subprocess completed.

This commit avoids the need for pump threads to copy data from subprocess
streams by using ProcessBuilder's existing Redirect functionality to either
write redirect stream output to files directly, or to inherit System.out and
System.err from the main process. This means that `lein test` etc now terminate
in a reasonable time again, and avoids the call to `exit` that was causing
problems for trampoline tasks.
mneise pushed a commit that referenced this issue Apr 24, 2017
Pull request #436 removes the call to exit that was added to address #171. This
caused a regression in testing and notify behaviour that was reported as #453,
where subprocesses would hang for 30 seconds after the subprocess completed.

This commit avoids the need for pump threads to copy data from subprocess
streams by using ProcessBuilder's existing Redirect functionality to either
write redirect stream output to files directly, or to inherit System.out and
System.err from the main process. This means that `lein test` etc now terminate
in a reasonable time again, and avoids the call to `exit` that was causing
problems for trampoline tasks.
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

3 participants