SessionPool readTimeout works incorrecly
Open
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.7k
- Forks
- 175
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 9
Description
When i specify readTimeout to Session.pool, pool cannot reuse session.
- Create pool with
readTimeout= 10 seconds - Make request. Wait more than timeout in my case is 3 minutes.
- Make another request
In debug i see this:
2021-02-18T12:17:24.835363+00:00 app[web.1]: → Query(BEGIN
2021-02-18T12:17:24.835365+00:00 app[web.1]: ISOLATION LEVEL SERIALIZABLE
2021-02-18T12:17:24.835369+00:00 app[web.1]: READ WRITE)
2021-02-18T12:17:24.835820+00:00 app[web.1]: TLS: wrap result: Status = OK HandshakeStatus = NOT_HANDSHAKING
2021-02-18T12:17:24.835821+00:00 app[web.1]: bytesConsumed = 87 bytesProduced = 116 sequenceNumber = 213
2021-02-18T12:17:24.839988+00:00 app[web.1]: → Query(UNLISTEN *)
2021-02-18T12:17:24.840394+00:00 app[web.1]: TLS: wrap result: Status = OK HandshakeStatus = NOT_HANDSHAKING
2021-02-18T12:17:24.840394+00:00 app[web.1]: bytesConsumed = 16 bytesProduced = 45 sequenceNumber = 214
If drop readTimeout - everything seams to work correctly. But how can i detect network failures in this case?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Session.pool behavior with readTimeout set to 10 seconds: make one request, wait longer than the timeout, then make another request. Trace how the pool handles the timed-out session and define done as successfully reusing sessions while still detecting network failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, scala
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100