client: Strange stats on some errors #252

Open
opened 2025-12-28 18:07:34 +00:00 by sami · 1 comment
Owner

Originally created by @cthulhu-rider on GitHub (Dec 9, 2024).

https://pkg.go.dev/github.com/nspcc-dev/neofs-sdk-go/client#PrmInit.SetStatisticCallback option allows to enable internal tracktion of op execution. For some errors, submitted stats look like a successful op completed insta

for example, ObjectDelete on ErrMissingSigner

Current Behavior

some errors are nil-ed and still submitted to the stat handler. With this, such results cannot differ from OK in general. At the same time, some homogeneous errors are transmitted as is (e.g. ObjectHash)

Expected Behavior

either

  1. skip stats for invalid input completely
  2. pass any error to the handler as it is

Possible Solution

i can suppose that it was an attempt to implement 1 to exclude user input errors which is not w/o sense. But for this I'd introduce a classification of errors accessible to the external user and let him decide for himself. Although in this case the internal stats lose their meaning becoming completely implementable around the base client

afaik all current errors are exported and documented, so 2 can be done

Steps to Reproduce

see exec statistics tests from https://github.com/nspcc-dev/neofs-sdk-go/pull/641

Regression

no i guess

Your Environment

Originally created by @cthulhu-rider on GitHub (Dec 9, 2024). https://pkg.go.dev/github.com/nspcc-dev/neofs-sdk-go/client#PrmInit.SetStatisticCallback option allows to enable internal tracktion of op execution. For some errors, submitted stats look like a successful op completed insta for example, `ObjectDelete` on [`ErrMissingSigner`](https://github.com/nspcc-dev/neofs-sdk-go/blob/335d9fe90f24494944c2888ef385f06f5f81dcfc/client/object_delete.go#L92) ## Current Behavior some errors are nil-ed and still submitted to the stat handler. With this, such results cannot differ from OK in general. At the same time, some homogeneous errors are transmitted as is (e.g. [`ObjectHash`](https://github.com/nspcc-dev/neofs-sdk-go/blob/335d9fe90f24494944c2888ef385f06f5f81dcfc/client/object_hash.go#L105)) ## Expected Behavior either 1. skip stats for invalid input completely 2. pass any error to the handler as it is ## Possible Solution i can suppose that it was an attempt to implement 1 to exclude user input errors which is not w/o sense. But for this I'd introduce a classification of errors accessible to the external user and let him decide for himself. Although in this case the internal stats lose their meaning becoming completely implementable around the base client afaik all current errors are exported and documented, so 2 can be done ## Steps to Reproduce see `exec statistics` tests from https://github.com/nspcc-dev/neofs-sdk-go/pull/641 ## Regression no i guess ## Your Environment * Version of the product used: 335d9fe90f24494944c2888ef385f06f5f81dcfc
Author
Owner

@roman-khimov commented on GitHub (Dec 9, 2024):

2 is the right thing to do here. It is a call. It has an error and time of some kind.

@roman-khimov commented on GitHub (Dec 9, 2024): 2 is the right thing to do here. It is a call. It has an error and time of some kind.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-sdk-go#252
No description provided.