Skip to content

feat: DM-4981: give every request a connect and read timeout - #59

Merged
AaronBarnes07 merged 3 commits into
mainfrom
DM-4981-request-timeout
Oct 21, 2026
Merged

AaronBarnes07 merged 3 commits into
mainfrom
DM-4981-request-timeout

Conversation

@AaronBarnes07

@AaronBarnes07 AaronBarnes07 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Requests now have a connect and a read timeout.

The client sent requests with no timeout, so a request to a server that accepts the connection and never answers did not return. A nightly smoke test hung for 15 hours this way: its login request waited on a TLS handshake that never finished.

  • DataMasqueInstanceConfig and DataMasqueIfmInstanceConfig have connect_timeout_seconds (default 10) and read_timeout_seconds (default 300).
  • Each client stores the pair and passes it as timeout on every request, including the IFM login and token refresh.
  • A request that times out raises DataMasqueTransportError.
  • Listed under 1.6.0 (unreleased) in HISTORY.rst, with the project field changes.

Tested against a local server that accepts the connection and never completes the handshake: 1.2.5 was still waiting when killed after 15 seconds, and this branch raised DataMasqueTransportError after its 2-second timeout.

@cph-datamasque cph-datamasque left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

300s sounds like quite a long timeout, but I kinda get it - we have certain slow endpoints like the RG CSV stuff.

Do we need to make a session adapter thing, instead of just storing off the (connect_timeout, read_timeout) tuple on the client class and passing it as a timeout parameter to the request call?

Comment thread datamasque/client/models/dm_instance.py Resolved
Comment thread datamasque/client/models/ifm.py Resolved
Comment thread tests/test_timeouts.py Resolved
Comment thread tests/test_timeouts.py Resolved
Comment thread HISTORY.rst Resolved
Comment thread HISTORY.rst Resolved
Comment thread datamasque/client/models/dm_instance.py Resolved
@AaronBarnes07

Copy link
Copy Markdown
Collaborator Author

Switched it to storing the (connect, read) tuple on the client and passing timeout on each request, kept 300s for the slow ones like the RG CSV stuff

@AaronBarnes07
AaronBarnes07 force-pushed the DM-4981-request-timeout branch from 3de2a0b to 697b116 Compare October 20, 2026 02:30
@AaronBarnes07 AaronBarnes07 self-assigned this Oct 21, 2026
@AaronBarnes07
AaronBarnes07 merged commit efda80a into main Oct 21, 2026
9 checks passed
@AaronBarnes07
AaronBarnes07 deleted the DM-4981-request-timeout branch October 21, 2026 00:51
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.

3 participants