Termination of big simulations sometimes failes
Summary
(Summarize the bug encountered concisely)
Steps to Reproduce
Run project 'Neue Regelstrategie/01 Referenzszenario' on branch us6362_*, wait until the simulation runs and then abort it.
Expected Behavior
Simulation termination succeeds
Actual Behaviour
During termination process the following error occurs:
Monolith "plc_monolith_Network_Controller" (ID 450, type "PLC") of 'ScenarioSchemaBasic(project_id=1, id=1, name='01 Referenzszenario', project_name='Neue Regelstrategie', folder_path=PosixPath('IW3/IWM'), variant_name='project')' terminated.
Exception in thread Handling element termination:
Traceback (most recent call last):
File "/home/philip/jarvis/distribution.py", line 1290, in handle_termination
self.join_element(
File "/home/philip/jarvis/distribution.py", line 1328, in join_element
element: InstantiatedElement = DBSession.scalars(
File "/home/philip/jarvis/.venv/lib/python3.8/site-packages/sqlalchemy/engine/result.py", line 1522, in one
return self._only_one_row(
File "/home/philip/jarvis/.venv/lib/python3.8/site-packages/sqlalchemy/engine/result.py", line 562, in _only_one_row
raise exc.NoResultFound(
sqlalchemy.exc.NoResultFound: No row was found when one was required
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/philip/.pyenv/versions/3.8.6/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/home/philip/.pyenv/versions/3.8.6/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/philip/jarvis/distribution.py", line 1316, in handle_termination
raise errors.MarkError("Unexpected error while listening for simulation data.") from e
errors.MarkError: Unexpected error while listening for simulation data.
The mark process crashes and needs to be restarted manually (so the GUI).