mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
Stream timeout seems too artificial and goes beyond the gRPC scope #240
Labels
No labels
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U2
U2
U3
U4
blocked
bug
client
config
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
pool
question
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-sdk-go#240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cthulhu-rider on GitHub (Nov 25, 2024).
Is your feature request related to a problem? Please describe.
https://pkg.go.dev/github.com/nspcc-dev/neofs-sdk-go/client#PrmDial.SetStreamTimeout setting timeout for the single stream message. The implementation is here
i see following cons about the existence of such a setting from the user pov:
Clientand does not depend on the current state. Moreover, current state of the system/network load is not transparent to the userDescribe the solution you'd like
purge this parameter and rely on user context only. This approach is adopted in the gRPC, and it is a good abstraction from the details of data transmission in the form of a stream: the user understands the complete operation only.
Describe alternatives you've considered
still drop the parameter, and also we can try to invent restrictions under the hood based on a user deadline. But for this we need to first build a working model, which should be based on the transport properties reported by the server. For now, this seems to artificial, and single deadline around transport abstraction seems best to me
Additional context
i remembe the parameter during refactoring https://github.com/nspcc-dev/neofs-sdk-go/pull/636
@roman-khimov commented on GitHub (Nov 25, 2024):
The main problem here is 1TB object GET. Per-request deadlines are perfect when objects are small. Once you have 1TB of data it becomes a bit different. What's the good timeout for this operation? Per-message timeouts allow to catch problems earlier in this case, but they're not perfect either.
@cthulhu-rider commented on GitHub (Nov 25, 2024):
there is no universal answer cuz GET user does not know the data size in general. If he is constrained by time, he will set a timeout for the entire operation. If not, there will be no deadline at all. Moreover, given the provided stream interfaces, the user can wrap his code with artificial deadlines himself. However, in almost all cases he will not want to do this
@cthulhu-rider commented on GitHub (May 5, 2025):
lookin at https://pkg.go.dev/google.golang.org/grpc#ClientStream
i noticed one more reason why such timeout makes no sense for client-side streams in particular (Object PUT only for now). This is very visible in practice. I measured time spent for
nspcc-dev/neofs-sdk-go@1af995ff59/client/object_put.go (L34)calls. All of them are completed in nanos, cuz they aint written to the wire insta. And onlynspcc-dev/neofs-sdk-go@1af995ff59/client/object_put.go (L36)takes a significant amount of time, almost equal to the whole durationso, for client streams, the option is not applicable in normal mode
server-side streams behave similarly, it's just that it's not requests that are cached but responses