spinach icon indicating copy to clipboard operation
spinach copied to clipboard

Non-idempotent jobs do not ever show as exit on a Redis broker

Open 0xDEC0DE opened this issue 1 year ago • 0 comments

Steps to reproduce

Prep

In one window:

docker-compose -f spinach/tests/docker-compose.yml up -d
docker-compose -f spinach/tests/docker-compose.yml exec redis redis-cli

Test

In another window:

import spinach
sp = spinach.Engine(spinach.RedisBroker())

@sp.task(name='hi_mom')
def hi_mom():
    print("Hi mom.")

sp.schedule('hi_mom')
sp.start_workers(stop_when_queue_empty=True)

Check

In the first window:

KEYS *

Expected result

An empty result, or an idempotency key.

Actual behavior

A _running-jobs-on-broker-* key is listed in the output. Its contents are the job that just finished, claiming to still be running.

0xDEC0DE avatar May 10 '24 00:05 0xDEC0DE