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.

max idle time and max lifetime have confusing semantics

See original GitHub issue

in JDBC-based connection pools such as Hikari or Tomcat, idle time applies to connection that are not in use and the max lifetime is checked for connections after they have been returned to the pool.

r2dbc-pool defaults max idle time to 30 minutes. this means that any applications that use connections for long periods of time (such as using the LISTEN feature in PostgreSQL) will have their in use connections unexpectedly terminated.

ideally, the two times would act similar to JDBC-based pools, limiting confusing for users with JDBC experience. alternatively, consider changing the names of the options to clearly indicate that they apply to in use connections.

(I do realize that the concepts here build upon reactor-pool’s notion of idle and life times; I think there’s an argument for enhancing reactor-pool to report on in-use vs idle discretely so it’s consumers can have differing behavior)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Oct 1, 2020

r2dbc-pool defaults max idle time to 30 minutes. this means that any applications that use connections for long periods of time (such as using the LISTEN feature in PostgreSQL) will have their in use connections unexpectedly terminated.

That shouldn’t be the case since a connection using the LISTEN feature is expected to be acquired and therefore it’s not idle.

How would you use LISTEN with Postgres? Would you acquire all connections, issue a LISTEN statement and put the connection back to the pool expecting it remains subscribed?

FWIW, I added a test that verifies that the idle timeout does not apply to connections that are acquired.

1reaction
mp911decommented, Sep 14, 2020

Thanks for raising this issue. It makes sense to align with JDBC pools regarding semantics.

Read more comments on GitHub >

github_iconTop Results From Across the Web

r2dbc-pool/CHANGELOG at main
Support configuration of minimum idle connections #141. * use GitHub Actions setup-java v2 # ... max idle time and max lifetime have confusing...
Read more >
java - What is the difference between maxIdleTime and ...
maxIdleTime defines the max idle time of connections. For example, after 20 minutes of idle time, the connection will be closed.
Read more >
When TCP sockets refuse to die
It sets the maximum amount of time that transmitted data may remain unacknowledged before the kernel forcefully closes the connection. On its ...
Read more >
Kafka 3.3 Documentation
Idle connections timeout: the server socket processor threads close the ... The token has a maximum lifetime beyond which it cannot be renewed...
Read more >
RFC 5190: Definitions of Managed Objects for Middlebox ...
Properties of sessions that are utilized by the MIDCOM semantics and not ... For example, FlowDirection and MaxIdleTime parameters in a MIDCOM rule...
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