knative-extensions/eventing-redis

Loop on error Cannot convert reply - redigo: nil returned

tdeverdiere opened this issue · 0 comments

Describe the bug
The redis stream can be trimmed using option MAXLEN on XADD command.
If a pending entry does not exist anymore in the stream the receiver adapter keeps looping on ID=0, and it never acknowledges the entry. So the stream consumer reads indefinitly in the same entry.

The fact that a pending entry is not in the stream anymore is not easy to reproduce and this case does not happen frequently.
But here restarting the receiver adapter does not solve the problem be cause consumer reads indefinitly the same pending entry.

Expected behavior
I would acknowledged the entry if redigo return 'nil returned'. Or i would add an option to allow it.

To Reproduce

  1. Add an entry into a Redis stream so the receiver adapter reads the entry but does not acknowledge it.
  2. Stop Redis
  3. Restart Redis
  4. Receiver adapter stays in a permanent error loop described here
  5. Execute XADD ... MAXLEN = 1 to limit the stream to 1. So the pending entry is not anymore in the stream
  6. Restart receiver adapter

Knative release version
1.15

Additional context
That is not a big problem if we fixed #387
And the stream could be cleaned by another service.

I would like to explore solutions, but how would i build the project and create a docker image for the receiver adapter? That would help me a lot. I should follow the getting started here: https://knative.dev/docs/getting-started ?