Skip to content

Conversation

Locke
Copy link
Contributor

@Locke Locke commented Jan 10, 2019

This PR fixes an assertion caused in emError handling that broke tests in the operator-dev branch.

It also fixes a wrongfully set engineBusy = false on termination/recover and replaces a Thread.yield loop with a blocking wait.

See the commit messages for more info.

Locke added 2 commits January 10, 2019 12:29
The main loop assumes that the engine is busy, however the handling of
the emError state sets engineBusy to false. This causes an assertion,
that was added in c750929 via #26, to trigger, which leads in debug
runs (-ea flag set) to a crashed Engine and a blocked TestEngineDriver.

Additionaly the engineBusy flag is set to false even when the Engine
is actually busy as the emError state is left to either emIdle or
emTerminating.

This commit 1) changes the assertion to not throw when in emError state
and 2) corrects the setting of engineBusy to be false only when no
ecTerminate / ecRecover command was handled.

TODO: This basic fix leaves the Engine in a Thread.yield loop until a
ecTerminate / ecRecover command is present. The polling of the
commandQueue should be replaced with a blocking wait.
.. with blocking wait for the next command. Also restore the assertion
that was changed in the previous commit as workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant