commanded / commanded/commanded

Skipped event with concurrency enabled

Open
#556 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Elixir
Stars
2k
Forks
258
PR merge metrics
No merged PRs in 30d

Description

I have the following setup:

Use Postgresql as an event store.
Have 150 events in the events table.
Created a TestHandler with concurrency = 5
Make TestHandler crash at event 40
The TestHandler is registered in the superviser with restart: :temporary.

Observed behavior:

  • error is logged
  • 2 pids died
  • the handler entry in the subscriptions table has last_seen = 150
  • when restarting the app/handler, all is fine, event is skipped

What is the course of action to avoid skipping events? What happens if i delpoy while the handlers are processing events. It may also kill pids and events are loaded based on the last_seen from the event store subscriptions table.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PostgreSQL event-store setup with a concurrency-5 TestHandler that crashes at event 40, then inspect how subscription last_seen is updated and how handlers restart. Determine the expected behavior for crashed processes and deployments; done means the behavior is defined and events are not skipped during handler failure or restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, postgresql
Domain
backend, databases, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.