Repository navigation
Guard late physics input and record plugin lifecycle hooks - #643
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge; the remaining concern is non-blocking crash diagnostics. Findings
SummaryGuards direct physics input after queue disposal and adds plugin hook markers to the diagnostic context.
Reviews (2) · Last reviewed commit: "plugins: persist hook markers without ri..." · Reviewed by Greptile |
| SetStatus(entry.Factory.Descriptor.Id, PluginState.Starting, phase.ToString(), phase); | ||
| using var deadline = CancellationTokenSource.CreateLinkedTokenSource(cancellation); | ||
| deadline.CancelAfter(StartupTimeout); | ||
| entry.Log.Info($"Entering plugin hook {phase}."); |
There was a problem hiding this comment.
With NLogPluginLog, these markers enter LogQueueTarget, whose writer waits up to 50 ms before draining. A native hook that crashes immediately can take down the process before its marker reaches the file. AutoFlush only helps after the writer receives the line.
Provide a way to write these markers durably before entering native-facing hooks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Late input during table teardown can reach the plunger after the native physics queue has been disposed. Check the queue under the same lock used for disposal before creating a direct physics state.
Persist the plugin ID and hook in the crash diagnostics snapshot before startup and teardown calls. A failed diagnostic write cannot interrupt cleanup.
Evidence
Merge Danger
The changes are reversible and affect direct physics mutations after native queue disposal and plugin lifecycle diagnostics.