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

AsyncCancelled if command takes a while. #38

Open
chrissound opened this issue Dec 23, 2018 · 7 comments
Open

AsyncCancelled if command takes a while. #38

chrissound opened this issue Dec 23, 2018 · 7 comments

Comments

@chrissound
Copy link

sos output.raw -c "sleep 0.15; echo 'test'"
Hit Ctrl+C to quit.

Modified: output.raw
[1/1] sleep 0.15; echo 'test'
AsyncCancelled
AsyncCancelled

Modified: output.raw
[1/1] sleep 0.15; echo 'test'
AsyncCancelled
AsyncCancelled

Modified: output.raw
[1/1] sleep 0.15; echo 'test'
AsyncCancelled
AsyncCancelled

Modified: output.raw
[1/1] sleep 0.15; echo 'test'
AsyncCancelled
AsyncCancelled

This only occurs if sleep 0.15 is present. echo 'test' is never run. This used to work without issue (I might have been on an older commit / version).

This occurs with the master branch (3eee0ec).

@chrissound
Copy link
Author

It works correctly on bc4cce6.

@filterfish
Copy link

filterfish commented Jun 10, 2019

I ran into this problem running pdflatex with no delay but running a later version fixed it.

EDIT 1: I typed too soon! It worked once and then I started getting the same error message as the OP.

I'm writing a latex document using vim and it seems to be a problem with the way vim saves the file. When saving the file in vim it occasionally works but if I touch the file it works every time. I'm using HEAD (3eee0ec).

EDIT 2: And I typed too soon. Again!

pdflatex creates a backup <file>~ which was triggering sos causing an entry that looked like this:

Added: how-to-debug-a-running-process.tex~                                     
[1/2] pdflatex how-to-debug-a-running-process.tex                              
AsyncCancelled                                                                                                                            
AsyncCancelled 

When I changed my match to .*\.tex$ it worked flawlessly.

Sorry for the noise but hopefully this might help someone else who runs into this problem. @schell maybe you could add it to the README?

@schell
Copy link
Owner

schell commented Jun 10, 2019

Thank you for the report @filterfish ! I'll add a blurb about it asap.

@sjakobi
Copy link

sjakobi commented Aug 25, 2020

I ran into this issue again while working with .tex files, but couldn't find an incantation that worked.

I ended up switching to fswatcher and using that with --throttle 100.

@osa1
Copy link

osa1 commented Aug 26, 2020

I'm also getting AsyncCancelled in a command, but in my case the command is not taking too long. I think the problem is the input file is getting updated a few times in quick successions which I'm guessing breaks stuff somehow. The sos invocation I'm using:

sos -p "(.*)\.wasm" -c "wasm2wat \1.wasm > \1.wat"

Input files are generated by a compiler and I think they may be updated a few times (e.g. it first crates it, then updates the file contents etc. or maybe flushes the file a few times).

Not sure if relevant, but I'm also seeing these lines when I stop sos with C-c:

Error removing watch: <wd=480>
Error removing watch: <wd=479>
Error removing watch: <wd=478>
Error removing watch: <wd=477>
...

I see a lot of these.

@schell
Copy link
Owner

schell commented Aug 26, 2020

We probably need to add a customizable throttle command like the fswatcher example above.

@chrissound
Copy link
Author

We probably need to add a customizable throttle command like the fswatcher example above.

Is it not a bug given it worked fine with a previous version? Sounds like a race condition from what I can understand. Looking at the diff between the working/non working commit - possibly a bug upstream as well, or just a change in behavior.

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

5 participants