Skip to content

Fix UB in the controller, and move the plugin error count to the worker module#2363

Merged
stevenengler merged 8 commits intoshadow:mainfrom
stevenengler:split-controller
Aug 19, 2022
Merged

Fix UB in the controller, and move the plugin error count to the worker module#2363
stevenengler merged 8 commits intoshadow:mainfrom
stevenengler:split-controller

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

The status logger is globally accessible through the controller, which is UB because the StatusLogger is not Sync. This PR makes the status logger's state global so that we can make the status logger itself non-global.

Also moves the plugin error count to worker::WORKER_SHARED to be more explicit that this is intended to be used as a global.

@stevenengler stevenengler added Type: Enhancement New functionality or improved design Type: Bug Error or flaw producing unexpected results labels Aug 18, 2022
@stevenengler stevenengler self-assigned this Aug 18, 2022
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Aug 18, 2022
This allows us to update the status from several places without needing to
share the entire status logger.
The status logger itself is already globally accessible through the controller,
which is actually UB because the `StatusLogger` is not `Sync`. By making the
status logger's state global, we can later make the status logger itself
non-global.
This fixes the UB where `StatusLogger` is shared between threads but is not
`Sync`.
It may sometimes take many real seconds to simulate one shadow second, so by
showing milliseconds in the simulation time we can see that the simulation time
is still advancing.
@stevenengler stevenengler enabled auto-merge August 19, 2022 19:45
@stevenengler stevenengler merged commit eeedac1 into shadow:main Aug 19, 2022
@stevenengler stevenengler deleted the split-controller branch August 19, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable Type: Bug Error or flaw producing unexpected results Type: Enhancement New functionality or improved design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants