fstree: Handle incomplete writes #1600
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1600
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-node:fix-fstree-write"
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?
The test is below, but it requires mounting, so I desided to not add it to code.
019cda8fba
to4843882853
4843882853
to01acf72835
01acf72835
to2bc86b5982
2bc86b5982
to85f369c076
New commits pushed, approval review dismissed automatically according to repository settings
@ -73,3 +74,2 @@
n, err := unix.Write(fd, data)
if err == nil {
if n == len(data) {
for err == nil {
Does frostfs-node write to
socket or pipe
? Looks likefor
loop is redundant.I find it more robust -- I am not sure it is completely impossible to get multiple incomplete writes (like with some network-mounted filesystem)
Then there is an error:
len(data)=10
loop 1:
n == 3, err == nil
written = 3
n, err = unix.Write(fd, data[3:])
n == 4, err == nil
loop 2:
n = 4
written = 7
n, err = unix.Write(fd, data[4:])
<--- oops!missed during refactoring, fixed!
good catch!
85f369c076
to05fd999162
New commits pushed, approval review dismissed automatically according to repository settings