-
Notifications
You must be signed in to change notification settings - Fork 22
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
Cancel Running Simulations #1243
Conversation
5e9800f
to
c0293dd
Compare
c0293dd
to
67e9505
Compare
67e9505
to
ec4e7c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! No major concerns
Key:
🔻 Issues to address before merge
🔶 Requests that should not block merge, but should at least be discussed
🔵 Recommendations that can be ignored if desired
merlin-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/MerlinWorkerAppDriver.java
Outdated
Show resolved
Hide resolved
merlin-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/MerlinWorkerAppDriver.java
Outdated
Show resolved
Hide resolved
- Remove auto-cancel triggers
ec4e7c2
to
21133b2
Compare
21133b2
to
7afd2fd
Compare
- Grab additional columns from SimulationDataset - Make e2eTests depend on Foo being assembled
7afd2fd
to
cf91ec6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick manual test, re-approving 👍
Description
Adds a
SimulationCancelListener
that, upon receiving a signal to cancel a simulation from the DB, sets a flag to tell the Driver to stop before it either picks up or begins to perform more work. With this change, the only time a simulation will not be stoppable aside from shutting down the container is if the user code contains an infinite loop. It also alters how thecanceled
flag is set in the DB to accurately reflect that "if this flag is set, then the simulation was canceled".Breakdown of commits:
simulation_cancel
channel when a simulation is canceled. The auto-cancel triggers were removed in order to give the users more control over when their simulations are canceled. This does mean that if anything is updated between a pending request and when it is picked up, it will now fail with an "Request is no longer relevant" message.simulate
.reason
field set to how far into simulation it was (using the same JSON structure as when simulation fails with an exception).Verification
foo
model.SimulationDatasets
in our e2eTests now contain the information from thestatus
andreason
columns.simulate
syntax. All of them were set to be uncancelable.Documentation
No docs need to be updated.
Future work
SimulationFailure
? Prior to this PR, it was exclusively being used to fill in thereason
column for failed simulations, but it's now also filling in thereason
column for canceled sims.incomplete
orpending
. Afailed
orsuccess
sim withcanceled
set totrue
implies that the simulation either finished or failed before it received thecanceled
signal)