Simplify services (part 4) #534
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#534
Loading…
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-node:simplify-services-part4"
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?
Port changes from #6.
Tested container creation and object put.
See also #533
@ -76,1 +35,3 @@
// SignResponse response with private key via signature.SignServiceMessage.
// The signature error affects the result depending on the protocol version:
// - if status return is supported, panics since we cannot return the failed status, because it will not be signed.
Only unsupported statuses cannot be signed?
Also, I don't see that
SignResponse
panics itself. Is it right that not signed error causes a panic?Okay, you have copy-pasted the comment from
Yes, I copypasted to minimize changes, panic is removed in the next commit.
LGTM
@ -208,2 +65,2 @@
if err = signResponse(s.key, resp, statusSupported); err != nil {
return nil, err
// WrapResponse creates an appropriate response struct if it is nil.
func WrapResponse[T any](resp *T, err error) (*T, error) {
util.WrapResponse
doesn't say anything about what the function does.I am not sure how to name this helper. Replaced with
EnsureNonNilResponse
.@ -210,3 +69,2 @@
}
return resp, nil
return new(T), nil
The error should also be returned.
fixed
@ -215,1 +73,3 @@
func isStatusSupported(req RequestMessage) bool {
// IsStatusSupported returns true iff request version implies expecting status return.
// This allows us to handle protocol versions <=2.10 (API statuses was introduced in 2.11 only).
func IsStatusSupported(req RequestMessage) bool {
Function name is
IsStatusSupported
, but actually the version is being checked.Yes, we can determine whether the status is supported from the API version. What is the problem?
Will be removed after #533 anyway.
The problem is the difference between the name of the method and what it actually does.
78076ea4d3
to5ff82ff04f