Fix access denied error handling for GET requests #1340

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/get_ape_err_handling into master 2024-08-28 12:15:05 +00:00
  1. Do not try to get object from remote nodes if local failed with AccessDenied error.
  2. Return AccessDenied error if remote get failed with AccessDenied error.
  3. Send header to output stream again if previous try fail with error.
1. Do not try to get object from remote nodes if local failed with AccessDenied error. 2. Return AccessDenied error if remote get failed with AccessDenied error. 3. Send header to output stream again if previous try fail with error.
dstepanov-yadro added 1 commit 2024-08-28 11:04:18 +00:00
[#1340] getSvc: Fix access denied error handling
All checks were successful
DCO action / DCO (pull_request) Successful in 4m23s
Tests and linters / Run gofumpt (pull_request) Successful in 4m14s
Vulncheck / Vulncheck (pull_request) Successful in 4m33s
Build / Build Components (1.22) (pull_request) Successful in 4m56s
Build / Build Components (1.23) (pull_request) Successful in 4m59s
Tests and linters / Tests (1.22) (pull_request) Successful in 5m2s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m6s
Tests and linters / Tests (1.23) (pull_request) Successful in 5m8s
Tests and linters / Lint (pull_request) Successful in 5m51s
Tests and linters / gopls check (pull_request) Successful in 6m13s
Tests and linters / Tests with -race (pull_request) Successful in 6m19s
Tests and linters / Staticcheck (pull_request) Successful in 1m48s
7abbdca064
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
aarifullin approved these changes 2024-08-28 11:07:27 +00:00
acid-ant approved these changes 2024-08-28 11:08:58 +00:00
fyrchik reviewed 2024-08-28 11:56:07 +00:00
@ -88,3 +88,1 @@
err = f.Stream.WriteHeader(ctx, objectSDK.NewFromV2(obj))
})
if err != nil {
f.headerSentGuard.Lock()
Owner

Missed this in support branch, could you explain, how is this different from sync.Once?

Missed this in support branch, could you explain, how is this different from `sync.Once`?
Author
Member

sync.Once doesn't take err into account: in case of error sync.Once will not run second time.

`sync.Once` doesn't take `err` into account: in case of error `sync.Once` will not run second time.
fyrchik marked this conversation as resolved
fyrchik approved these changes 2024-08-28 12:15:00 +00:00
fyrchik merged commit 7abbdca064 into master 2024-08-28 12:15:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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: TrueCloudLab/frostfs-node#1340
No description provided.