Skip to content

Commit 71adb6b

Browse files
committed
only the creator of the CV should delete it from the map
1 parent 5bb12d2 commit 71adb6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dbos/system_database.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,8 +1354,10 @@ func (s *systemDatabase) GetEvent(ctx context.Context, input WorkflowGetEventInp
13541354
// Defer broadcast to ensure any waiting goroutines eventually unlock
13551355
defer func() {
13561356
cond.Broadcast()
1357-
// Clean up the condition variable after we're done
1358-
s.notificationsMap.Delete(payload)
1357+
// Clean up the condition variable after we're done, if we created it
1358+
if !loaded {
1359+
s.notificationsMap.Delete(payload)
1360+
}
13591361
}()
13601362

13611363
// Check if the event already exists in the database

0 commit comments

Comments
 (0)