Streamline active job collection.#153650
Conversation
|
Is it correct to radically change the shard locking behaviour like this? |
|
Looks like this effectively reverts #148777, which was a bugfix specifically relying on calling
I disagree, the first thing is a good map, the second thing is an erroneous map for diagnostics. |
|
Thanks for the info! Looks like making this a draft PR was the right decision :) I still don't like the code structure. Even with the comments it was strange enough that I misunderstood what it was doing. I'll try to find another approach to improve that while preserving the I also wonder why a test wasn't added in #148777. My understanding of parallel front-end testing is poor, this might force me to look into it. |
|
The testing isn't even merged yet, the relevant PR is #143953. |
|
The Only three of them are used in practice. Maybe and |
|
I think the bottom two cases are confused. The Also IIRC, when |
Fixed, thanks.
Good point. All the more reason for the enum. |
|
I don't think it's acceptable that the compiler panics during reporting the depth limit. |
that's better than a bool + Result 👍 |
cb7eef1 to
48bfc79
Compare
|
I have updated the code to use the three-value enum. I'm not 100% sure about the names, happy to hear alternative suggestions there. |
Tests for A-parallel-compiler bugs are nearly impossible to make consistent. They shouldn't be relied upon unless you can relatively consistently reproduce a test failure on your branch's base commit and then can no longer reproduce the test failure on the branch itself. I even have fixed bugs without being able to reproduce A-parallel-compiler issue to begin with, just by diagnosing the source problem. |
This comment has been minimized.
This comment has been minimized.
`collect_active_jobs_from_all_queries` takes a `require_complete` bool, and then some callers `expect` a full map result while others allow a partial map result. The end result is four possible combinations, but only three of them are used/make sense. This commit introduces `CollectActiveJobsKind`, a three-value enum that describes the three sensible combinations, and rewrites `collect_active_jobs_from_all_queries` around it. This makes it and its call sites much clearer, and removes the weird `Option<()>` and `Result<QueryJobMap, QueryJobMap>` return types. Other changes of note. - `active` is removed. The comment about `make_frame` is out of date, and `create_deferred_query_stack_frame` *is* safe to call with the query state locked. - When shard locking failure is allowed, collection no longer stops on the first failed shard.
48bfc79 to
454e301
Compare
collect_active_jobs_from_all_queriestakes arequire_completebool, and then some callersexpecta full map result while others allow a partial map result. The end result is four possible combinations, but only three of them are used/make sense.This commit introduces
CollectActiveJobsKind, a three-value enum that describes the three sensible combinations, and rewritescollect_active_jobs_from_all_queriesaround it. This makes it and its call sites much clearer, and removes the weirdOption<()>andResult<QueryJobMap, QueryJobMap>return types.Other changes of note.
activeis removed. The comment aboutmake_frameis out of date, andcreate_deferred_query_stack_frameis safe to call with the query state locked.