Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a-nogikh
Copy link
Collaborator

Return two values -- the request to execute and a boolean flag to indicate whether more requests are coming.

@a-nogikh a-nogikh requested a review from dvyukov June 27, 2024 15:33
syz-manager/manager.go Outdated Show resolved Hide resolved
@@ -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()
Copy link
Collaborator

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?

Copy link
Collaborator Author

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():
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants