question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection not released when request is cancelled

See original GitHub issue

Bug Report

Versions

  • Driver: Driver: 0.8.8.RELEASE
  • Database: Posgresql 12.7
  • Java: 11
  • OS: Windows

Current Behavior

This issue was first opened on r2dbc-postgresql, some discussion can be seen there https://github.com/pgjdbc/r2dbc-postgresql/issues/459

Then it was opened here: https://github.com/r2dbc/r2dbc-pool/issues/140

The result was a fix on the pool but it does not fix the problem.

We have created a new project without spring dependencies and the connection keeps getting stucked.

You can find the source code here: https://github.com/jfrossetto/r2dbc-stress-cancel

pid datname usename application_name backend_start query_start query
3065 postgres postgres sample 2021-11-01 10:02:41.308 2021-11-01 10:02:45.159 SELECT 1
3064 postgres postgres sample 2021-11-01 10:02:41.307 2021-11-01 10:02:46.358 SELECT 1
3066 postgres postgres sample 2021-11-01 10:02:45.640 2021-11-01 10:02:50.739 SELECT 1

LOGFILE: https://github.com/jfrossetto/r2dbc-stress-cancel/blob/master/log_stresscancel.txt

There was another issue opened with the same problem here: https://github.com/r2dbc/r2dbc-pool/issues/143

Stack trace
// your stack trace here

Table schema

Input Code
-- your SQL here;

Steps to reproduce

Input Code
// your code here;

Expected behavior/code

Possible Solution

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
mp911decommented, Jan 4, 2022

I can confirm that upgrading to Reactor Core 3.4.14 snapshots fixes the issue.

1reaction
Ernircommented, Dec 27, 2021

Commenting for increased visibility - looks like the reactor-core team has a potential solution, see https://github.com/reactor/reactor-core/pull/2859 .

If you can reproduce the issue locally, confirmation that the fix works is desired. See https://github.com/reactor/reactor-core/issues/2836#issuecomment-999797297 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection not released when request is cancelled · Issue #140
When these requests gets cancelled right after the validation query have runned establishing the connection as healthy, and before the real SQL ...
Read more >
r2dbc-pool connection not released after cancel - Stack Overflow
MOST IMPORTANTLY: some of the connections are acquired and never gets released, even if all threads are cancelled and none are active anymore....
Read more >
I canceled my request in ILLiad, but it is not showing as ...
Here are the steps you can take to make sure the request is canceled on OCLC. Restart your ILLiad Connection Manager service on...
Read more >
node-mssql | Microsoft SQL Server client for Node.js
ECANCEL ( RequestError ) - Cancelled. ENOCONN ( RequestError ) - No connection is specified for that request. ENOTOPEN ( ConnectionError ) -...
Read more >
How to detect if a request was cancelled from client on Ktor ...
I can successfully see that the connection has been terminated on the server and I have the opportunity to release any hang resources....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found