-
Notifications
You must be signed in to change notification settings - Fork 109
supervisor: fix large opaque data handle #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
imeoer
commented
Aug 16, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #613 +/- ##
==========================================
+ Coverage 21.82% 22.07% +0.24%
==========================================
Files 122 122
Lines 10730 10746 +16
==========================================
+ Hits 2342 2372 +30
+ Misses 8070 8054 -16
- Partials 318 320 +2
|
} | ||
|
||
func (mss *MemStatesStorage) Write(data []byte) { | ||
l := copy(mss.data[mss.head:], data) | ||
mss.head += l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without head
, States storage can't support append-write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, we haven't needed append yet. :)
306cf98
to
2101000
Compare
When the supervisor needs to process a large amount of opaque data (for example, a nydusd instance has a large number of sub mounts, and the opaque is usually larger than 32kb), a recvmsg / sendmsg system call cannot process all data. The commit fixes the problem with multiple recvmsg/sendmsg calls and updates the test cases. Signed-off-by: Yan Song <yansong.ys@antgroup.com>
return nil, 0, err | ||
} | ||
|
||
return data, su.fd, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if fd is positive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ok, but maybe we don't have to limit it.
}) | ||
|
||
eg.Go(func() error { | ||
err := receiver() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why trigger
and receiver
have to run in parallel in separted goroutines?