mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-11 07:13:44 +00:00
fix(ugc): stopping the UGC server cancels the models being made
Stopping waited for every worker to finish its model, and with the path traced hidden-face removal a big model takes minutes, so a restart hung. UgcThrottle::Cancel(true) (set by UgcProcessor::Stop) makes Checkpoint, which the long loops already call, throw UgcThrottle::Cancelled; the worker abandons the job without writing or recording anything, so its row stays waiting and is made again after the restart. The throttle's sleeps wake to check it. Previews answer 503. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1755,3 +1755,12 @@ TEST(UgcHsr, SamplePointsFollowTheTrianglesSize) {
|
||||
EXPECT_LE(dense.size(), 40u);
|
||||
EXPECT_EQ(UgcHsr::SamplePoints({ 0, 0, 0 }, { 1.6f, 0, 0 }, { 1.6f, 0, 1.6f }, 0.1143f, 28).size(), 100u); // bigger ones as before
|
||||
}
|
||||
|
||||
// Stopping the server cancels the jobs being made: Checkpoint throws until the cancel is cleared
|
||||
TEST(UgcThrottle, CancelStopsJobsAtTheirNextCheckpoint) {
|
||||
UgcThrottle::Cancel(true);
|
||||
EXPECT_TRUE(UgcThrottle::IsCancelled());
|
||||
EXPECT_THROW(UgcThrottle::Checkpoint(), UgcThrottle::Cancelled);
|
||||
UgcThrottle::Cancel(false);
|
||||
EXPECT_NO_THROW(UgcThrottle::Checkpoint());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user