Fix repeating-timer leak in parachute delete polling#92
Open
Smiggus wants to merge 1 commit into
Open
Conversation
ScheduleChuteDeleteWithPolling and PollUntilEmptyThenDeleteChute passed repeat=true to CallLater while also manually rescheduling the poll with retryCount + 1. Every parachute exit therefore registered a repeating 200 ms timer that is never removed, and each poll iteration registered another one. The repeating instances fire with a stale retryCount so they never hit the max-retries exit; they keep invoking the poll for the rest of the server session. Timer count grows with every jump, degrading server performance over mission time. The retryCount design is a one-shot rescheduling loop, so pass repeat=false in both places. Poll cadence and delete behavior are unchanged. Symptoms this should address: gradually increasing server frame time and script load during and after airborne operations.
227ab11 to
9959bd2
Compare
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.
ScheduleChuteDeleteWithPollingandPollUntilEmptyThenDeleteChutepassrepeat = truetoCallLaterwhile also manually rescheduling the poll withretryCount + 1. Every parachute exit therefore registers a repeating 200 ms timer that is never removed, and each poll iteration registers another one. The repeating instances fire with a stale retryCount, so they never hit the max-retries exit and keep invoking the poll for the rest of the server session. Timer count grows with every jump.Practical effect: gradually increasing script load and degrading server performance over mission time, worst during and after airborne operations with many jumpers.
The retryCount design is a one-shot rescheduling loop, so this passes
repeat = falsein both places. Poll cadence (200 ms), retry cap (20), and delete behavior are unchanged.Testing suggestion: on a test server, run 20 or more parachute jumps, then compare script profiler / frame time against current main. On main the poll function keeps firing after all chutes are gone; with this fix it stops.