-
Notifications
You must be signed in to change notification settings - Fork 35
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
async_job not starting job #33
Comments
I don't see anything peculiar or wrong about your usage, so it could be a bug or an issue with the zsh zpty module. What version of zsh are you using? To debug this issue further, it might be good to add some logging, perhaps you could apply the following patch: diff --git a/async.zsh b/async.zsh
index fb273b1..1906d7e 100644
--- a/async.zsh
+++ b/async.zsh
@@ -68,7 +68,7 @@ _async_worker() {
# worker. For example: `fork failed: resource temporarily unavailable`.
# Some older versions of zsh might also print malloc errors (know to happen
# on at least zsh 5.0.2 and 5.0.8) likely due to kill signals.
- exec 2>/dev/null
+ exec 2>>/tmp/async_worker-err.log
# When a zpty is deleted (using -d) all the zpty instances created before
# the one being deleted receive a SIGHUP, unless we catch it, the async
@@ -157,6 +157,8 @@ _async_worker() {
# occurs, a failure to read probably indicates that stdin has
# closed. This is why we propagate the signal to all children and
# exit manually.
+ print Exit code: $? >>/tmp/async_worker_exit.log
+ typeset -p request &>>/tmp/async_worker_exit.log
kill -HUP -$$ # Send SIGHUP to all jobs.
exit 0
} And see if the log files produce anything of interest? You might also want to add a "catch all" to your callback function and log it, as async can sometimes inform of errors that have occurred, like: async.zsh#L320 for example. I wonder if this could be related to sindresorhus/pure#455. Although, in that issue, restarting the worker does not help in my experience (only a new shell does). |
I've added those prints, and a few others... but I still don't see the reason why after a while it stops working. In the logs I do see the
Running
|
With debug logs enabled, I'm also experiencing |
I believe this issue is caused by My guess is that there are certain cases where the worker can't handle the For now, I've created a branch of For an example of how this is detected, you could check our the |
I've been using zsh-async on a theme (based on zprezto's sorin prompt) but I've frequently noticed async stops working.
I only initialize the worker once, during
precmd
:Not knowing why, I added some logging and I'm now seeing
async_job
is being called, but the job function (prompt_kronuz_async_git
) is not... as if the worker had died?Is there a way I could list active workers? ...or how can I know if worker died? ...and why?
Edit:
If I call
zpty
, I see this:(finished) prompt_kronuz: _async_worker -p 89022 -n
... which sure enough shows the async worker as finished. Is there a way to know why, or if it's finished automatically restart it?The text was updated successfully, but these errors were encountered: