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

Remove terminated connections from the pool. #51

Merged
merged 1 commit into from Dec 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/sqlalchemy/dialects/mssql/pymssql.py
Expand Up @@ -86,6 +86,7 @@ def create_connect_args(self, url):
def is_disconnect(self, e, connection, cursor):
for msg in (
"Adaptive Server connection timed out",
"Net-Lib error during Connection reset by peer",
"message 20003", # connection timeout
"Error 10054",
"Not connected to any MS SQL server",
Expand Down
7 changes: 4 additions & 3 deletions test/dialect/mssql/test_engine.py
Expand Up @@ -131,10 +131,11 @@ def test_pymssql_disconnect(self):

for error in [
'Adaptive Server connection timed out',
'Net-Lib error during Connection reset by peer',
'message 20003',
"Error 10054",
"Not connected to any MS SQL server",
"Connection is closed"
'Error 10054',
'Not connected to any MS SQL server',
'Connection is closed'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The quoting was inconsistent in the file, so I cleaned it up, but can remove that if you don't like it.

]:
eq_(dialect.is_disconnect(error, None, None), True)

Expand Down