Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceNotFoundException if shard does not exist #16

Open
jhecking opened this issue Jul 2, 2021 · 0 comments · May be fixed by #17
Open

ResourceNotFoundException if shard does not exist #16

jhecking opened this issue Jul 2, 2021 · 0 comments · May be fixed by #17

Comments

@jhecking
Copy link

jhecking commented Jul 2, 2021

We persist the stream's shard state periodically. When the service restarts, it loads the last known shard state. Occasionally this throws an error if the saved state contains a shard, which no longer exists:

22021-07-02T02:15:08.675Z (node:7) UnhandledPromiseRejectionWarning: ResourceNotFoundException: Requested resource not found: Shard does not exist
32021-07-02T02:15:08.675Z     at deserializeAws_json1_0GetShardIteratorCommandError (/var/app/node_modules/@aws-sdk/client-dynamodb-streams/dist/cjs/protocols/Aws_json1_0.js:240:41)
42021-07-02T02:15:08.675Z     at runMicrotasks (<anonymous>)
52021-07-02T02:15:08.675Z     at processTicksAndRejections (internal/process/task_queues.js:95:5)
62021-07-02T02:15:08.675Z     at async /var/app/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20
72021-07-02T02:15:08.675Z     at async /var/app/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:12:24
82021-07-02T02:15:08.675Z     at async StandardRetryStrategy.retry (/var/app/node_modules/@aws-sdk/middleware-retry/dist/cjs/StandardRetryStrategy.js:51:46)
92021-07-02T02:15:08.675Z     at async /var/app/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22
102021-07-02T02:15:08.675Z     at async DynamoDBStream._getShardIterator (/var/app/node_modules/dynamodb-stream/index.js:150:29)
112021-07-02T02:15:08.675Z     at async dispatch (/var/app/node_modules/@kessler/async-map-limit/impl.js:30:22)

I think the client should just ignore such errors and remove the shard from its list.

@jhecking jhecking linked a pull request Jul 2, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant