Skip to content

fix: return query_timeout instead of closed on deadline#124

Open
Taure wants to merge 1 commit intoerleans:mainfrom
Taure:fix/timeout-error-message
Open

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

Conversation

@Taure
Copy link

@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
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

1 participant