Improve resource startup/shutdown handling and fix some edge cases in the checksum pipeline - #5135
Merged
Dutchman101 merged 1 commit intoAug 2, 2026
Conversation
… the checksum pipeline
Lpsd
approved these changes
Aug 2, 2026
1 task
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.
A cleanup pass on how the server deals with resources that fail to start, plus some improvements to how file checksums are handled and a couple of smaller fixes.
Resource startup and shutdown
Start() had several spots where it could give up early, but most of them didn't clean up properly -- elements, the VM, storage, and the element group could be left behind depending on which thing failed. Now every failure path tears down whatever it already set up, and clients are told to remove the resource's elements so nothing gets left dangling on their side either. The timestamp that tracks when a resource last started is now properly reset when a start fails, and the failure reason string is cleared at the start of each load/start attempt so old errors don't stick around.
Stop() also had a problem where the final state change event was never actually reaching scripts because it ran after the resource element was already deleted. That's been moved so it fires at the right time.
Checksum handling
A few improvements around when and how file checksums are computed and stored. The main ones are making sure blocked files don't get their checksums saved (which could mess up change detection), doing a fresh check of the file on disk at start time instead of trusting whatever was computed during the earlier load, and double-checking the checksum right before copying a file to the HTTP cache in case the file changed in between.
Other fixes
Files
Server/mods/deathmatch/logic/CResource.cpp
Server/mods/deathmatch/logic/CResourceManager.cpp
Server/mods/deathmatch/logic/CConsoleCommands.cpp
Shared/sdk/SharedUtil.ThreadPool.h