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

Ctrl-C not working anymore to abort #142

Closed
ghost opened this issue Jun 27, 2018 · 7 comments
Closed

Ctrl-C not working anymore to abort #142

ghost opened this issue Jun 27, 2018 · 7 comments
Assignees
Labels
Ctrl-c Signals Signals issues.

Comments

@ghost
Copy link

ghost commented Jun 27, 2018

I keep getting this

Got a signal INT (my PID is 2738)
Hit 2 ctr-c within 2 seconds to exit the program
Hit only 1 ctr-c to reconnect to both imap servers
For now only one signal INT within 2 seconds.
@gilleslamiral
Copy link
Member

gilleslamiral commented Jun 27, 2018

I've encountered this behavior with some terminals as well.
An xterm is usually ok but gnome-terminal ignores the double ctrl-c
I don't know why.
Ctrl-z should work, it doesn't end the process but it gives back the control of the terminal.
To end the process, add

kill  2738 # from the line "Got a signal INT (my PID is 2738)"
fg 

@gilleslamiral gilleslamiral self-assigned this Sep 1, 2018
@gilleslamiral gilleslamiral added Signals Signals issues. Ctrl-c labels Sep 1, 2018
@gilleslamiral
Copy link
Member

Imapsync revision 1.929 added:
Bug fix: When asked to terminate by a signal, kill myself by the signal instead of an exit call. Applied Martin Cracauer's advice on Proper handling of SIGINT/SIGQUIT. I hope it fixes the not always working double-ctrl-c to end the sync.

@gilleslamiral
Copy link
Member

I'm closing this issue. I've seen no recent report about this "double ctr-c not working".

@0x3333
Copy link

0x3333 commented Jul 30, 2019

I use not that often imapsync in Docker and I see this issue pretty everytime. Maybe it is related to docker, by I have to kill the process.. it doesn't work.

@gilleslamiral gilleslamiral reopened this Jul 31, 2019
@gilleslamiral
Copy link
Member

That's interesting, I've just tested this and you're right!

docker run gilleslamiral/imapsync imapsync --testslive --simulong 5
...
Are you still here ETA: 16/25 msgs left
Are you still here ETA: 15/25 msgs left
Are you still here ETA: 14/25 msgs left
^C
Got a signal INT (my PID is 1 my PPID is 0)
Hit 2 ctr-c within 2 seconds to exit the program
Hit only 1 ctr-c to reconnect to both imap servers
For now only one signal INT within 2 seconds.
Are you still here ETA: 13/25 msgs left
^CAre you still here ETA: 12/25 msgs left
Got two signals INT within 2 seconds. Exiting...

Got a signal INT (my PID is 1 my PPID is 0). Asked to terminate
Killing myself with signal INT
Are you still here ETA: 11/25 msgs left
Are you still here ETA: 10/25 msgs left
Are you still here ETA: 9/25 msgs left
Are you still here ETA: 8/25 msgs left
...

@gilleslamiral
Copy link
Member

The good thing when a developer can reproduce an issue by himself is that soon enough the issue is solved.

I have updated the docker image in order to make ctr-c works well under docker.
https://hub.docker.com/r/gilleslamiral/imapsync

Try it with:

    docker pull gilleslamiral/imapsync

    docker run gilleslamiral/imapsync imapsync --testslive --simulong 30
    # Hit ctr-c and see!

@0x3333
Copy link

0x3333 commented Aug 1, 2019

Wow. That was fast! T
Working great now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ctrl-c Signals Signals issues.
Projects
None yet
Development

No branches or pull requests

2 participants