Skip to content

fix: return query_timeout instead of closed on deadline#124

Merged
tsloughter merged 1 commit intoerleans:mainfrom
Taure:fix/timeout-error-message
Mar 16, 2026
Merged

fix: return query_timeout instead of closed on deadline#124
tsloughter merged 1 commit intoerleans:mainfrom
Taure:fix/timeout-error-message

Conversation

@Taure
Copy link
Copy Markdown
Contributor

@Taure Taure commented Mar 13, 2026

Summary

  • When a pool deadline fires during query execution, the socket is closed and recv returns {error, closed}, which is indistinguishable from actual connection failures
  • Now detects deadline-triggered disconnects by checking if the holder ETS table was deleted by the pool, and returns {error, query_timeout} instead
  • Also handles {error, einval} which can occur in the same scenario depending on timing

Closes #96

Test plan

  • New query_timeout test added to pgo_SUITE — verifies pg_sleep(5) with 500ms timeout returns {error, query_timeout}
  • All 55 CT tests pass
  • xref clean

When a pool deadline fires during query execution, the socket is
closed and recv returns {error, closed}. This is indistinguishable
from actual connection failures. Now detect deadline-triggered
disconnects by checking if the holder ETS table was deleted, and
return {error, query_timeout} instead.

Closes erleans#96
@tsloughter tsloughter merged commit 0521dba into erleans:main Mar 16, 2026
4 checks passed
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.

Improved error for timeout

2 participants