perf(concurrency): cancel remaining goroutines when has error#9484
perf(concurrency): cancel remaining goroutines when has error#9484eileenaaa wants to merge 3 commits intodgraph-io:mainfrom
Conversation
|
Can you instead use errGroup to do the same thing? |
Yes, that works. I’ve implemented the same logic using an errgroup with context—please review code again. Also, a quick question: since we’re using egCtx (from errgroup.WithContext(ctx)), |
|
If we don't have that check, it could take a long time for a thread to finish as this one thread with no errors could take long when other threads have been cancelled. |
Description
This PR optimizes goroutine execution in multi-task scenarios:
This improves system responsiveness and reduces wasted CPU cycles in error cases.
Checklist
CHANGELOG.mdfile describing and linking tothis PR