You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2026/05/24 13:28:14 UTC

[I] new feature: allow timeout for go binding [opendal]

dentiny opened a new issue, #7609:
URL: https://github.com/apache/opendal/issues/7609

   ### Feature Description
   
   Hi team, when I'm reading the go binding code, I found we don't have an elegant way to control operation timeout.
   - All IO operations don't take context as argument, which means we cannot propagate timeout and cancellation as normal golang program
   - Operator is built in C and exposed via FFI, which only integrates retry layer but not timeout layer, which means we don't have default timeout config
   - go binding doesn't expose layer interface for customization, which means we cannot hook timeout layer at golang level
   
   The only way I could think of is `select` + timer, but it's not an ideal solution because
   - Much more verbose than golang-native context-based solution
   - IO happening is not cancelled in rust
   
   ### Problem and Solution
   
   I think (1) context-based function interface, (2) customized layer, (3) timeout layer as default are required.
   
   ### Additional Context
   
   _No response_
   
   ### Are you willing to contribute to the development of this feature?
   
   - [ ] Yes, I am willing to contribute to the development of this feature.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] new feature: allow timeout for go binding [opendal]

Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on issue #7609:
URL: https://github.com/apache/opendal/issues/7609#issuecomment-4528954930

   I think a custom layer would be the better approach here. Other bindings, such as Java, also expose similar capabilities through layers.
   
   Adding a default timeout layer in the C binding itself would probably not be ideal. The Go binding provides a purego-based way to load and call the OpenDAL C dylib, and that dylib can be built from the OpenDAL C binding.
   
   Although `opendal-go-services` provides prebuilt dylib artifacts, it is not a required dependency of the Go binding. As a temporary solution, you may build your own C dylib with a timeout layer configured, and then use that dylib with the Go binding.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] new feature: allow timeout for go binding [opendal]

Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns closed issue #7609: new feature: allow timeout for go binding
URL: https://github.com/apache/opendal/issues/7609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] new feature: allow timeout for go binding [opendal]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on issue #7609:
URL: https://github.com/apache/opendal/issues/7609#issuecomment-4528989810

   Thanks for the quick reply!
   
   > I think a custom layer would be the better approach here. Other bindings, such as Java, also expose similar capabilities through layers.
   
   For sure; what do you think of passing context? It's go-native way.
   
   > Adding a default timeout layer in the C binding itself would probably not be ideal.
   
   The reason is: timeout and retry is the most important and required layers IMO.
   
   > As a temporary solution, you may build your own C dylib with a timeout layer configured, and then use that dylib with the Go binding.
   
   I cannot take the hacky solution in production. :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org