mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
client: Stats of failed object GET/RANGE/SEARCH are submitted only on Close #251
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#251
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 (Dec 9, 2024).
currently, server-streamed ops call stat handler only when user calls
Close. But for such opsCloseis only used when user is no longer interested in the stream. Unlike PUT when user signals that data is finished via Close. For example, following code looks completely OK:Current Behavior
-stats
Expected Behavior
+stats
Possible Solution
do not require calling
Close. Submit stats whenever stream is finished (io.EOF==OK!). Update docsSteps to Reproduce
exec statisticscases from #641Regression
quite possible, but i havent checked
Your Environment
335d9fe90f@roman-khimov commented on GitHub (Dec 9, 2024):
That was a deliberate choice because previously this statistics was "collected" for each
r.Read()call. Tying it toClose()was the easiest way to go. The main question here --- isClose()optional? It's not to me, we're providingio.ReaderCloser, most of the time people are supposed to callClose()to release some resource in this case.@cthulhu-rider commented on GitHub (Dec 10, 2024):
@roman-khimov i meant this in terms of stats. We can submit real stats when stream is done and
Read()returns an error regardless of closing. This is what i actually propose. I just noticedFailure reason can be received via Close.in docs, and this is not quire true. AfterRead()returns an error,Close()is no-op and returns the sameoverall, i agree that closer is nice thing todo. For reading ops, it should be performed
deferly. According to gRPC server-side stream semantics, currently it is always no-op except when user interrupts reading when data is no longer needed@roman-khimov commented on GitHub (Dec 10, 2024):
We can do a lot of things, the question is should we? To me it works fine already wrt statistics. Users must
Close()and that's where you get your overall statistics.@cthulhu-rider commented on GitHub (Dec 10, 2024):
the imposition is excessive, the stream works differently. UX improvement is desirable imo. Being a user, i'd be grateful for the stats that came even if I forgot closer
@roman-khimov commented on GitHub (Dec 10, 2024):
I doubt anyone cares much about streams that drive all of this. But people know https://pkg.go.dev/os#File, they know https://pkg.go.dev/io#ReadCloser, not calling
Close()foros.Fileis an error, forio.ReadCloserthe general expectation is the same.@roman-khimov commented on GitHub (Dec 10, 2024):
Body in https://pkg.go.dev/net/http#Response is the same, btw. It is an error not to
Close()it.@cthulhu-rider commented on GitHub (Dec 10, 2024):
interface itself states no such requirements. 'Specific implementations may document their own behavior' and that's it
op stats and resource release in different planes to me. Exactly like successful reading 1GB data from file and forgotten descriptor