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

Attic doesn't handle connections issues when using remote repo #130

Open
thiagoc opened this issue Nov 20, 2014 · 2 comments
Open

Attic doesn't handle connections issues when using remote repo #130

thiagoc opened this issue Nov 20, 2014 · 2 comments

Comments

@thiagoc
Copy link

thiagoc commented Nov 20, 2014

This is how I'm testing:

  • Run attic create ... in one terminal
  • Wait some minutes
  • Run conntrack -D -p tcp --dport 22 in another terminal

Attic is still running (??) after some minutes. Hit CTRL+C, it display attic: Error: Keyboard interrupt but doesn't stop after some more minutes. Hit CTRL+C again and:

Exception ignored in: <bound method RemoteRepository.__del__ of <attic.remote.RemoteRepository object at 0x7f6d230fecc0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/attic/remote.py", line 124, in __del__
    self.close()
  File "/usr/local/lib/python3.4/site-packages/attic/remote.py", line 243, in close
    self.p.wait()
  File "/usr/local/lib/python3.4/subprocess.py", line 1565, in wait
    (pid, sts) = self._try_wait(0)
  File "/usr/local/lib/python3.4/subprocess.py", line 1513, in _try_wait
    (pid, sts) = _eintr_retry_call(os.waitpid, self.pid, wait_flags)
  File "/usr/local/lib/python3.4/subprocess.py", line 491, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt: 
@ThomasWaldmann
Copy link
Contributor

This report seems to be rather related to how KeyboardInterrupt was handled than connection issues (as the issue title says).

attic.archiver.main catches KeyboardInterrupt exception and shows the Error: Keyboad Interrupt. After that (in current code), it just does sys.exit(1).

So, can you clarify / reproduce with current code?

@ThomasWaldmann
Copy link
Contributor

In .close() it closes stdin/stdout pipes and then waits for the ssh subprocess to terminate.

In your case, ssh seems unwilling to terminate, so maybe giving that timeout argument to .wait() would help a little with that.

https://docs.python.org/3/library/subprocess.html#subprocess.Popen.wait

Hmm, not sure any more if that is a good idea - esp. for cases when close is called and it is not due to Ctrl-C, but within normal operations...

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

2 participants