-
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
pkg/fuzzer/queue: change the queue.Source interface #4944
base: master
Are you sure you want to change the base?
Conversation
pkg/rpcserver/rpcserver.go
Outdated
@@ -389,7 +389,7 @@ func (serv *Server) connectionLoop(runner *Runner) error { | |||
} | |||
} | |||
for len(runner.requests)-len(runner.executing) < 2*serv.cfg.Procs { | |||
req := serv.execSource.Next() | |||
req, _ := serv.execSource.Next() |
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.
It should shutdown and exit on stop?
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.
Updated the code to wait for all requests to complete and exit.
if stop { | ||
break loop | ||
} else if req == nil { | ||
// No new requests so far, but there might be. | ||
select { | ||
case <-cfg.Context.Done(): |
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.
We don't need this context if we have stop.
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.
I think that shutting RunLocal()
down must not necessarily depend on the queue.Source
saying it doesn't have any more inputs -- e.g. the fuzzer is not supposed to even run out of them.
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.
I don't follow.
User of RunLocal provides the source. Why would that source return stop when there is no intention to stop? And what's the difference between returning stop the source and cancelling the context? When what should be used? If they mean the same, why do we need 2 ways to express it?
Return two values -- the request to execute and a boolean flag to indicate whether more requests are coming.
Return two values -- the request to execute and a boolean flag to indicate whether more requests are coming.