-
Notifications
You must be signed in to change notification settings - Fork 1k
status: make collectConstraints() concurrent #1413
status: make collectConstraints() concurrent #1413
Conversation
I think there was no returned |
29be995
to
88ac250
Compare
So the reason for the test failures is I think the error is related to the test setup. Something to do with the created temporary directory structure that's causing |
17797a9
to
8a978e5
Compare
Alright, got it! I wasn't setting root of the project. p.SetRoot(filepath.Join(pwd, "src")) fixed it. No errors. So, Also, since even partial results are not bad in this case, I think we need not use golang.org/x/sync/errgroup, but |
Sorting of projectConstraints is required to have a consistent returned value from collectConstraints().
Errors from collectConstraints() should not result in failure of status. These errors are logged to stderr and the error count is added to `errCount` of `runStatusAll()`. This results in letting the user know about incomplete status result, keeping the status output clean. Running status in verbose mode would show all those errors.
8a978e5
to
e8a2617
Compare
What does this do / why do we need it?
It makes
collectConstraints()
concurrent. We need this to reduce the running time of status, which increased recently to ~30s due to introduction ofcollectConstraints()
. This change brings the time down to ~5s.Verbose output shows constraints collection progress:
What should your reviewer look out for in this PR?
Concurrency implementation.
Do you need help or clarification on anything?
Should we return errors in
collectConstraints()
? I didn't change the return signature initially while implementing but now I think maybe we should. With this change, any error incollectConstraints()
won't affect status but would print the error only when in verbose mode.