Skip to content

Dispose leaked CancellationTokenSource and do a little cleanup in ConnectorPool - #3214

Merged
Brar merged 1 commit into
npgsql:mainfrom
Brar:ConnectorPoolCleanup
Oct 5, 2020
Merged

Brar merged 1 commit into
npgsql:mainfrom
Brar:ConnectorPoolCleanup

Conversation

@Brar

@Brar Brar commented Oct 5, 2020

Copy link
Copy Markdown
Member

Add a missing using statement to a CancellationTokenSource in
ConnectorPool.RentAsync() and whilte at it:

  • link the passed cancellationToken instead of using Register()
  • move the creation of the CancellationTokenSource out of the loop
  • do a little cleanup regarding duplicated code

@Brar
Brar requested review from YohDeadfall and roji as code owners October 5, 2020 10:43
@Brar Brar self-assigned this Oct 5, 2020

@roji roji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @Brar - see my one question on ThrowIfCancellationRequested, but otherwise LGTM.

Comment thread src/Npgsql/ConnectorPool.cs Resolved
@Brar
Brar force-pushed the ConnectorPoolCleanup branch from f04b37e to d2fe5d6 Compare October 5, 2020 17:24
Add a missing using statement to a CancellationTokenSource in
ConnectorPool.RentAsync() and whilte at it:
- link the passed cancellationToken instead of using Register()
- move the creation of the CancellationTokenSource out of the loop
- do a little cleanup regarding duplicated code
@Brar
Brar force-pushed the ConnectorPoolCleanup branch from d2fe5d6 to 099a308 Compare October 5, 2020 17:25
@Brar
Brar merged commit 1ae09c9 into npgsql:main Oct 5, 2020
Brar referenced this pull request Oct 21, 2020
And a general refactor of how cancellation works
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.

2 participants