Skip to content

Fix IllegalStateException when Simulating during Scheduling#1846

Open
Mythicaeda wants to merge 2 commits into
developfrom
fix/scheduler-illegalstate-exception
Open

Fix IllegalStateException when Simulating during Scheduling#1846
Mythicaeda wants to merge 2 commits into
developfrom
fix/scheduler-illegalstate-exception

Conversation

@Mythicaeda

Copy link
Copy Markdown
Contributor

Description

The method PlanSimCorrespondence#equalsWithIdMap has been reworked. Before, it was implicitly assuming that every activity on the plan was distinct in some way. It no longer makes that assumption, instead making the value in the inverted maps a List of ActivityDirectiveIds instead of just a single ActivityDirectiveId.

Additionally, the method now fast-fails when the number of directives in the two PlanSimCorrespondences differ. Before, if the only difference between two PlanSimCorrespondences was a new activity, the method would only realize that after it had done all the work of populating the result map.

Verification

A new e2e test was added that schedules the procedural goal DumbRecurrenceGoal twice. DumbRecurrenceGoal is a goal that will always trigger this bug when it is scheduled more than once. This test fails on develop but passes on this branch.

A manual test can be done for this bug with the following Verification steps:

  1. Deploy the develop branch
  2. Run ./gradlew buildAllProcedureJars --parallel to build the test JARs
  3. Create a new plan and add the DumbRecurrenceGoal to its scheduling spec. Be sure to give it an argument for the biteSize parameter
  4. Schedule the plan twice. Expected result: the second run should fail with an IllegalStateException
  5. Checkout this branch, rebuild and redeploy (I recommend doing this without taking down the volumes, but if you do take them down, then repeat steps 2 and 3)
  6. Schedule the plan as many times as you wish. There will be no more exception and each run will add more BiteBanana activities

@Mythicaeda Mythicaeda self-assigned this Jul 6, 2026
@Mythicaeda Mythicaeda requested a review from a team as a code owner July 6, 2026 22:15
@Mythicaeda Mythicaeda added fix A bug fix scheduling Anything related to the scheduling domain labels Jul 6, 2026
@Mythicaeda Mythicaeda force-pushed the fix/scheduler-illegalstate-exception branch from 8c6eb97 to 668debc Compare July 6, 2026 22:23
@Mythicaeda Mythicaeda force-pushed the fix/scheduler-illegalstate-exception branch from 668debc to a47e19a Compare July 7, 2026 21:40
The method now accounts for the existence of multiple activities that are identical sans ids
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix scheduling Anything related to the scheduling domain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IllegalStateException when Simulating during Scheduling

1 participant