Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add sentinel value to allow per-request infinite timeout in API queries #900

Merged

Conversation

fregataa
Copy link
Contributor

@fregataa fregataa commented Sep 20, 2024

What do these changes do?

  • Add Sentinel singleton value to allow None (infinite timeout) arguments in the Docker._query() and Docker._do_query() based APIs.
  • Add a timeout parameter to DockerImages.pull() method.

Are there changes in behavior for the user?

Users can now pass a float or None to the timeout parameter in the pull() API.
Previously, None meant the fallback to the session-configured default timeout, and thus users could not set the infinite timeout for specific API queries like pulling.

If the user code has not set any timeout argument, they will work as the same: falling back to the session-level timeout.
If the user code has deliberately set the timeout to None, their semantics are changed from the fallback session-level timeouts to individually set infinite timeouts ignoring the session-level timeout.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the changes folder
    • name it <issue_id>.<type> for example (588.bug)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.10%. Comparing base (5148c63) to head (49b51e4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
+ Coverage   80.99%   81.10%   +0.10%     
==========================================
  Files          24       24              
  Lines        1426     1434       +8     
  Branches      255      256       +1     
==========================================
+ Hits         1155     1163       +8     
  Misses        177      177              
  Partials       94       94              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@achimnol achimnol changed the title feat: Add sentinel value to allow 'None' timeout value when query feat: Add sentinel value to allow per-request infinite timeout in API queries Sep 23, 2024
@achimnol achimnol enabled auto-merge (squash) September 23, 2024 04:18
@achimnol achimnol merged commit a0a30c2 into aio-libs:main Sep 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants