steeloverseer icon indicating copy to clipboard operation
steeloverseer copied to clipboard

AsyncCancelled if command takes a while.

Open chrissound opened this issue 7 years ago • 7 comments

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 (3eee0ec9490aec4795e2daed30cd67e5f0802c12).

chrissound avatar Dec 23 '18 21:12 chrissound

It works correctly on bc4cce6a6fbf36817381d2a63dfe5ba6b9c01765.

chrissound avatar Dec 23 '18 21:12 chrissound

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?

filterfish avatar Jun 10 '19 03:06 filterfish

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

schell avatar Jun 10 '19 18:06 schell

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.

sjakobi avatar Aug 25 '20 09:08 sjakobi

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.

osa1 avatar Aug 26 '20 07:08 osa1

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

schell avatar Aug 26 '20 17:08 schell

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.

chrissound avatar Aug 31 '20 10:08 chrissound