From ebdc8c19da54756a0969e2b2c624f2eae3ea8aff Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 27 Feb 2026 12:05:41 +0100 Subject: made local action submits more async by introducing "submitting" state --- src/zencompute/functionservice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/zencompute/functionservice.cpp') diff --git a/src/zencompute/functionservice.cpp b/src/zencompute/functionservice.cpp index fa4656ac4..42b009319 100644 --- a/src/zencompute/functionservice.cpp +++ b/src/zencompute/functionservice.cpp @@ -49,6 +49,8 @@ using namespace std::literals; namespace zen::compute { +static_assert(ZEN_ARRAY_COUNT(FunctionServiceSession::ActionHistoryEntry::Timestamps) == static_cast(RunnerAction::State::_Count)); + ////////////////////////////////////////////////////////////////////////// struct FunctionServiceSession::Impl @@ -789,6 +791,9 @@ FunctionServiceSession::Impl::SchedulePendingActions() ActionsToSchedule.push_back(Pending); break; + case RunnerAction::State::Submitting: + break; // already claimed by async submission + case RunnerAction::State::Running: case RunnerAction::State::Completed: case RunnerAction::State::Failed: @@ -905,6 +910,9 @@ FunctionServiceSession::Impl::HandleActionUpdates() m_PendingLock.WithExclusiveLock([&] { m_PendingActions.insert({ActionLsn, Action}); }); break; + case RunnerAction::State::Submitting: + break; // still in pending map, async submission in progress + case RunnerAction::State::Running: m_PendingLock.WithExclusiveLock([&] { m_RunningLock.WithExclusiveLock([&] { -- cgit v1.2.3