typelevel / typelevel/skunk

SessionPool readTimeout works incorrecly

Open
#384 1 comment 0 reactions 0 assignees View on GitHub

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.

  1. Create pool with readTimeout = 10 seconds
  2. Make request. Wait more than timeout in my case is 3 minutes.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.