Enable parallel MessageCodeGenerator task execution by default, including GenerateMojo multi-version aggregation, with thread-safe state and task-scoped logging#1233
Conversation
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/3cc2ab86-f818-4d6f-8294-e0d1805a7497 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
|
@copilot please add logging output how many parallel tasks are used |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/35104349-ab05-422d-861f-1bd35f967d72 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Implemented in commit |
|
@copilot make generator.parallelExecution true by default. |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/3e8c2bde-9960-418c-9e64-f8f4d450726f Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Done in commit |
|
@copilot parallel execution might work when calling main() of the code generator. However, it does not work when using the GenerateMojo. So the mojo needs the information for all possible executions for the various fix versions at once. Currently there are several executions in quickfixj-messages/quickfixj-messages-all/pom.xml |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/ae17ca4b-feff-443e-a2d8-ade9e02e1fc9 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Implemented in commit |
|
@copilot looking good so far.
|
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/1dcb0259-f870-44c3-9304-d4eb7980b33b Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Implemented in commit |
|
@copilot the test ParallelExecutionOptionTest.testParallelExecutionIsEnabledByDefault is flaky. It expects that the tasks always finish in the same order. Keep the assertions that verify:
|
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/58f57ec9-970d-4117-8c1f-67f4377c307c Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Addressed in commit |
|
@copilot Java.lang.AssertionError |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/5b3b5f51-92b8-47c2-821b-05c1abc079c8 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Fixed in commit |
MessageCodeGeneratorexecuted version-generation tasks serially and shared mutable state without concurrency guarantees. This change introduces parallel task execution for multi-task generation by default, ensures generator internals are safe under concurrency, and makes concurrent logs separable per task.Parallel execution control
generate(List<Task>).generator.parallelExecution(defaulttrue).generate(Task)behavior intact; multi-task execution falls back to sequential when disabled (generator.parallelExecution=false) or when only one task is provided.Thread-safety hardening
ConcurrentHashMapto prevent races during concurrent dictionary parsing/reuse.Task-scoped logging for concurrent runs
ThreadLocallog context.[FIX44] ...) so interleaved logs remain attributable.Started task for <taskName> (x / y)Finished task for <taskName> (x / y)These are emitted for both sequential and parallel multi-task execution.
CLI flow update
mainnow builds all version tasks and dispatches throughgenerate(List<Task>), so parallel mode applies to standard generator CLI usage.Maven plugin flow update (GenerateMojo)
GenerateMojoto accept an optional<tasks>list and build all configured generator tasks in a single mojo execution.GenerateMojonow dispatches viagenerator.generate(List<Task>), so parallel mode applies in Maven plugin usage (not only viamain).dictFile/packagingetc.).quickfixj-messages-all plugin configuration update
quickfixj-codegenerator:generateexecutions with one aggregated execution containing all FIX-version tasks.quickfixj-messages-all.Targeted regression coverage
ParallelExecutionOptionTestto verify:generator.parallelExecution=falsegenerator.parallelExecution=truegenerator.parallelExecutionis unset (default behavior)