Skip to content

feat: provide timeout for each operation#7176

Closed
dheeraj12347 wants to merge 0 commit intoapache:mainfrom
dheeraj12347:main
Closed

feat: provide timeout for each operation#7176
dheeraj12347 wants to merge 0 commit intoapache:mainfrom
dheeraj12347:main

Conversation

@dheeraj12347
Copy link

This PR implements per-operation timeout support as requested in #7168.

Changes:

Added timeout field and with_timeout method to OpRead, OpWrite, OpStat, and OpList in core.

Updated TimeoutLayer to prioritize per-operation timeouts over global defaults.

Fixes: #7168

@dheeraj12347 dheeraj12347 requested a review from Xuanwo as a code owner February 1, 2026 11:13
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 1, 2026
@dosubot
Copy link

dosubot bot commented Feb 1, 2026

Related Documentation

No published documentation to review for changes on this repository.

Write your first living document

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Feb 1, 2026
/// Default to `false`
deleted: bool,
/// The timeout for this operation.
timeout: Option<Duration>,
Copy link
Member

Choose a reason for hiding this comment

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

Thank you, but Layer's behavior should never be injected into ops level.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, but Layer's behavior should never be injected into ops level.

Thank you for the feedback, @Xuanwo. I understand now that the ops level should remain agnostic of Layer behaviors.

To support per-operation timeouts without injecting them into raw/ops.rs, would you recommend using Operator::call with a custom context, or is there a preferred pattern in OpenDAL for passing per-request configurations to Layers? I'll revert the changes to ops.rs and refactor accordingly.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, but Layer's behavior should never be injected into ops level.

I have pushed the refactored TimeoutLayer. It now handles timeouts entirely within the layer, and I've reverted all changes to the core ops.rs. The code is now architecturally clean and passes local checks. Looking forward to your guidance on the best way to re-introduce per-operation overrides!

@dheeraj12347 dheeraj12347 requested a review from Xuanwo February 3, 2026 07:02
@Xuanwo
Copy link
Member

Xuanwo commented Feb 3, 2026

Hi, @dheeraj12347, please review your own PR before requesting a maintainer's review. This PR has now been marked as a low-quality contribution. If no further improvement is provided, I will close it directly.

Reasons: This PR does not address the problem, but instead removes many existing comments. If you are unsure how to proceed, please return to the discussion before starting a PR.

@dheeraj12347
Copy link
Author

Hi, @dheeraj12347, please review your own PR before requesting a maintainer's review. This PR has now been marked as a low-quality contribution. If no further improvement is provided, I will close it directly.

Reasons: This PR does not address the problem, but instead removes many existing comments. If you are unsure how to proceed, please return to the discussion before starting a PR.

Hi @Xuanwo, I sincerely apologize for the oversight. I see now that my last refactor accidentally removed existing comments and didn't solve the core issue as intended. I am stepping back to re-evaluate the architecture and will restore the deleted documentation immediately. I'll move the technical discussion back to the issue #7168 before making further pushes to ensure I'm aligned with OpenDAL's design principles. Thank you for your patience.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: provide timeout for each operation

2 participants