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

Handle a connection abort error on shutdown #2319

Merged
merged 1 commit into from
Apr 20, 2015

Conversation

blink1073
Copy link
Contributor

I was getting the following traceback on shutdown, which is now avoided:

*** End of MainWindow setup ***
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/Users/silvester/anaconda/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/Users/silvester/anaconda/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/silvester/workspace/spyder/spyderlib/spyder.py", line 2641, in start_open_files_server
    req, dummy = self.open_files_server.accept()
  File "/Users/silvester/anaconda/lib/python3.4/socket.py", line 187, in accept
    fd, addr = self._accept()
ConnectionAbortedError: [Errno 53] Software caused connection abort

@@ -358,7 +358,7 @@ def __init__(self, options=None):
# Tour # TODO: Should I consider it a plugin?? or?
self.tour = None
self.tours_available = None

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert blanks deletion :-)

@blink1073
Copy link
Contributor Author

Fixed ws and added a fix for Windows.

@@ -2646,6 +2646,9 @@ def start_open_files_server(self):
# To avoid a traceback after closing on Windows
if e.args[0] == eintr:
continue
# handle a connection abort on close error
if e.args[0] in [errno.ECONNABORTED, errno.ENOTSOCK]:
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why here return and not continue? I say it because I tried to fix this error in commit e18294f but I thought the right thing to do was to use continue. Later I had to revert that one because complained that Spyder took up to half an hour to start or close!! :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also forgot to mention that errno.ENOTSOCK is not available on Windows. See my referenced commit for the right error on Win.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used return because it only happened at shutdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is so frustrating when they do that in the standard library.

@ccordoba12 ccordoba12 added this to the v3.0 milestone Apr 16, 2015
@blink1073
Copy link
Contributor Author

Whoops, fixed.

@goanpeca
Copy link
Member

@blink1073 squashing into a single commit?

Handle a connection abort error on shutdown

Revert some ws changes

Revert more ws changes

Revert one more ws change

Revert all ws changes

Add shutdown handling on windows

Another ws revert

Make the error check cross platform

Reinstate the Econnaborted check
@blink1073
Copy link
Contributor Author

Done.

@ccordoba12
Copy link
Member

Ok, let's hope this fixes this problem once and for all :-)

Merging!

ccordoba12 added a commit that referenced this pull request Apr 20, 2015
Handle a connection abort error on shutdown
@ccordoba12 ccordoba12 merged commit cac2848 into spyder-ide:master Apr 20, 2015
@blink1073
Copy link
Contributor Author

Much nicer without that pesky error on shutdown!

@ccordoba12
Copy link
Member

Yes, absolutely!! I've been trying to fix this bug for months without success :-)

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

Successfully merging this pull request may close these issues.

3 participants