-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add separate send queue for kbfs file edit messages skipping the outbox #23530
Conversation
Can you please wait for me to review this as well before you merge? I'll look tomorrow. |
Probably can't work this way, I'd like the calls from KBFS to still return to it immediately. |
e13b398
to
26600b5
Compare
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.
sorry for the large diff here, thought deliverer was better suited in a separate file. marked the actual changes with comments
|
||
s.delivering = true | ||
s.shutdownCh = make(chan struct{}) | ||
s.eg.Go(func() error { return s.deliverLoop(s.shutdownCh) }) |
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.
changed to support multiple loops
s.Debug(ctx, "stopping") | ||
close(s.shutdownCh) | ||
s.delivering = false | ||
go func() { |
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.
block cb until loops finish
defer s.Trace(ctx, func() error { return err }, "Queue")() | ||
|
||
// KBFSFILEEDIT msgs skip the traditional outbox | ||
if msg.ClientHeader.Conv.TopicType == chat1.TopicType_KBFSFILEEDIT { |
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.
skip outbox for kbfs files
return true | ||
} | ||
|
||
func (s *Deliverer) kbfsDeliverLoop(shutdownCh chan struct{}) error { |
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.
read off of kbfs queue and do send
With no more KBFS changes, there's no need to wait for my review anymore. But I'm curious how this fixes the actual deadlock in the original report. is it just an orthogonal fix that will slow down the processing of kbfs edit requests? Or does it fix the actual, persistent deadlock observed in that issue? |
@strib I'll look further into the deadlock, this PR is just to address the load on the chat system. |
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.
Diff is hard to parse, but I agree Deliverer
deserves its own file. Hope it works!
b316d3d
to
de28afa
Compare
…ox (#23530) * Limit the number of concurrent KBFS chat posts, use post local instead of nonblock rpc * pseudo nonblock * deliverer * Fix kbfs loop * merge
No description provided.