Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle task scheduling in ResumableSimulationDriver #1262

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

adrienmaillard
Copy link
Contributor

@adrienmaillard adrienmaillard commented Dec 19, 2023

Description

Here is an example of how the issue has manifested:

  • The scheduler has to simulate a plan with activities A and B with B anchored to A.
  • After simulation, the scheduler tries to query the duration of task B, it fails
  • Indeed, the resumable simulation driver does not have a direct reference to task B because of how anchored activities were managed, that is, by creating an anonymous task that would include the A, a delay, then B. The driver would remember the id of this anonymous task but not the id of task B precisely. The id of a task is given when the task is scheduled and in this case, the simulation engine would schedule task A and B, not the driver.

The solution consists in replacing this anonymous task creation with a mechanism that lets the driver schedule dependent tasks as soon as their dependent is finishing. Handling task creation allows to maintaining references to task ids and solve the above issue.

Verification

A simple test that was not passing before has been added.

Documentation

N/A

Future work

N/A

@adrienmaillard adrienmaillard added fix A bug fix scheduling Anything related to the scheduling domain simulation Anything related to the simulation domain labels Dec 19, 2023
@adrienmaillard adrienmaillard added this to the FY24 Q1 - Bug Fixes milestone Dec 19, 2023
@adrienmaillard adrienmaillard self-assigned this Dec 19, 2023
@adrienmaillard adrienmaillard requested a review from a team as a code owner December 19, 2023 22:29
@adrienmaillard adrienmaillard force-pushed the fix-resumable-driver-anchors branch from 8116244 to 7d51acd Compare December 19, 2023 22:30
Copy link
Contributor

@Mythicaeda Mythicaeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you either update or add a new Anchor Integration test in SchedulingIntegrationTests that uses a non-controllable duration activity? The fact that all of those tests use GrowBanana was how this bug slipped by for so long.

This allows to remember references to scheduled tasks and thus to fix the bug resulting from the taskid of an anchored task not to be saved in plannedDirectiveToTask because they were scheduled by the sim engine.
All other tests are with growbanana
@adrienmaillard
Copy link
Contributor Author

Good catch, I forgot this, I have updated the GrowBanana of one test to a PickBanana.

@adrienmaillard
Copy link
Contributor Author

I'd like to point out that this PR is strictly removing code, which should be celebrated somehow :p

Copy link
Contributor

@Mythicaeda Mythicaeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@adrienmaillard adrienmaillard merged commit 73b3ece into develop Dec 20, 2023
6 checks passed
@adrienmaillard adrienmaillard deleted the fix-resumable-driver-anchors branch December 20, 2023 01:09
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 simulation Anything related to the simulation domain
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

State of resumable simulation driver is not properly maintained
2 participants