aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/jobqueue.cpp
diff options
context:
space:
mode:
authorEPICGAMES\thierry.begin <[email protected]>2024-04-08 10:43:16 -0400
committerEPICGAMES\thierry.begin <[email protected]>2024-04-08 10:43:16 -0400
commitb35e1258a043cab06950b2453f434861d99b918a (patch)
tree695737774fa08ebaa0e32a9f95cb0247c34b3dc3 /src/zencore/jobqueue.cpp
parentAdd docker support (diff)
parentMerge pull request #41 from ue-foundation/zs/import-oplog-clean (diff)
downloadzen-tb/docker.tar.xz
zen-tb/docker.zip
Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen into tb/dockertb/docker
Diffstat (limited to 'src/zencore/jobqueue.cpp')
-rw-r--r--src/zencore/jobqueue.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/zencore/jobqueue.cpp b/src/zencore/jobqueue.cpp
index 86c08cda9..d26d0dd1e 100644
--- a/src/zencore/jobqueue.cpp
+++ b/src/zencore/jobqueue.cpp
@@ -69,7 +69,7 @@ public:
Stop();
}
}
- catch (std::exception& Ex)
+ catch (const std::exception& Ex)
{
ZEN_WARN("Failed shutting down jobqueue. Reason: '{}'", Ex.what());
}
@@ -106,7 +106,7 @@ public:
});
return {.Id = NewJobId};
}
- catch (std::exception& Ex)
+ catch (const std::exception& Ex)
{
WorkerCounter.CountDown();
QueueLock.WithExclusiveLock([&]() {
@@ -359,7 +359,18 @@ public:
CompletedJobs.insert_or_assign(CurrentJob->Id.Id, std::move(CurrentJob));
});
}
- catch (std::exception& Ex)
+ catch (const AssertException& Ex)
+ {
+ ZEN_DEBUG("Background job {}:'{}' asserted. Reason: {}", CurrentJob->Id.Id, CurrentJob->Name, Ex.FullDescription());
+ QueueLock.WithExclusiveLock([&]() {
+ CurrentJob->State.AbortReason = Ex.FullDescription();
+ CurrentJob->EndTick = JobClock::Now();
+ CurrentJob->WorkerThreadId = 0;
+ RunningJobs.erase(CurrentJob->Id.Id);
+ AbortedJobs.insert_or_assign(CurrentJob->Id.Id, std::move(CurrentJob));
+ });
+ }
+ catch (const std::exception& Ex)
{
ZEN_DEBUG("Background job {}:'{}' aborted. Reason: '{}'", CurrentJob->Id.Id, CurrentJob->Name, Ex.what());
QueueLock.WithExclusiveLock([&]() {