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

Recover connection state counting after external close #9792

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

ajcvickers
Copy link
Contributor

Issue #9524

The issue here was the reference count was not kept correctly if the connection was closed externally when it was not expected to be. The fix is to keep the count correct in this case.

_openedCount++;
}

_openedCount++;
Copy link
Member

Choose a reason for hiding this comment

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

Interesting that the tests pass, but this won't work for connection resiliency. Count would be incremented on every retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AndriySvyryd I added a test using connection resiliency and fixed a test bug, but can't get product code to to fail. Probably going to need some help writing a test that demonstrates this.

Copy link
Member

Choose a reason for hiding this comment

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

I found the issue in test code: TestRelationalTransaction.ClearTransaction() calls _testConnection.Close() for some reason, hiding the product bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AndriySvyryd I simplified TestRelationalTransaction and TestSqlServerConnection so that they don't have any logic other than causing failures...still can't reproduce the issue.

Copy link
Member

Choose a reason for hiding this comment

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

I see, that was unrelated then. The code you added to TestRelationalCommandBuilderFactory hides a bug.
I've also added tests for the other places where an ExecutionStrategy is used: see origin\MoreResiliencyTests ce4bf0d

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New bits up with query fix.

Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

Add tests for and fix connection resiliency

@ajcvickers ajcvickers force-pushed the ConnStatPrime0514 branch 3 times, most recently from 7f1c8dc to abd3931 Compare September 20, 2017 21:13
Issue #9524

The issue here was the reference count was not kept correctly if the connection was closed externally when it was not expected to be. The fix is to keep the count correct in this case.
@ajcvickers ajcvickers merged commit ef95d9f into dev Sep 20, 2017
@smitpatel smitpatel deleted the ConnStatPrime0514 branch September 21, 2017 20:43
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.

4 participants