Skip to content

Deferred execution duplicate index (MongoDB) error #957

Closed
@stefan-buys

Description

@stefan-buys

Describe the bug
When making use of the deferred execution (as demo'd in https://github.com/danielgerlag/workflow-core/tree/master/src/samples/WorkflowCore.Sample05),

e.g.
return ExecutionResult.Sleep(pollingDelay, new object());

I notice the following error (log):
A write operation resulted in an error. WriteError: { Category : "DuplicateKey", Code : 11000, Message : "E11000 duplicate key error collection: foobar.wfc.scheduled_commands index: idx_key dup key: { CommandName: "ProcessWorkflow", Data: "619cefda1e173f3b8cc532be" }" }.

To Reproduce
Run multiple hosts (6 at the moment) using MongoDB persistence; RedisLocking, RediseQueues and RedisEventHub. Defer the execution for an activity (as instructed at https://github.com/danielgerlag/workflow-core/tree/master/src/samples/WorkflowCore.Sample05).

When the activity is deferred, an error is logged out every 10 seconds.

Expected behavior
Activity should be delayed/deferred, execute and no errors be highlighted in logs

Additional context
running WorkflowCore 3.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions