Skip to content

fix(client): Resume after gap fill error #1570

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

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

teogeb
Copy link
Contributor

@teogeb teogeb commented Jun 19, 2023

If storage node responds with an error, it is considered as en empty response.

Before this PR the pipeline stopped to process any subsequent messages for the subscription (including all real-time messages which we'd receive in the future) if there was a storage node error.

The output stream was closed here:

this.outBuffer.endWrite(err)

See also this TODO:

() => this.maybeClose(), // probably noop, TODO: handle gapfill errors without closing stream or logging

The endWrite(err) call was added in this commit: d07be0e

Future improvements

  • Maybe we could analyze error rates: if all/most resend requests to some storage node fail, it would make sense to drop that storage node from the list of used storage nodes (and use other storage nodes for gap filling if there are any).

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz
@github-actions github-actions bot added the client Related to Client Package label Jun 19, 2023
@teogeb teogeb requested a review from harbu June 19, 2023 19:52
teogeb added 2 commits June 21, 2023 11:50

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz
@github-actions github-actions bot added the docs label Jun 21, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz
@teogeb teogeb merged commit 7110f28 into main Jun 21, 2023
@teogeb teogeb deleted the client-resume-after-gap-fill-error branch June 21, 2023 14:00
teogeb added a commit that referenced this pull request Jun 22, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz
When an error occurs in message ordering, the `OrderedMsgChain` calls an `onError` callback which is registered by the `OrderMessages` class. There is a parameter in that call, but `OrderMessages` doesn't use the value.

See https://github.com/streamr-dev/network/blob/73b83c0cc2af716a3b09c71f13cb05665cee25fe/packages/client/src/subscribe/OrderMessages.ts#L51

Refactored error handler to be just a callback without arguments and removed the custom `GapFillFailedError` class.

### Open questions

In PR #1570 we changed the error handling functionality so that the pipeline can continue to process messages after error. There we consider the error case as an empty result. But if we want we could notify subscription somehow if there is an error.

If we want to notify, should we emit error only when there is a storage node error, or maybe also when we can't fill the gap (i.e. don't find the missing messages from the storage node). See: https://github.com/streamr-dev/network/blob/73b83c0cc2af716a3b09c71f13cb05665cee25fe/packages/client/test/unit/OrderedMsgChain.test.ts#L429

- If we want to notify the subscription, we should use `StreamrClientError` instead of custom `GapFillFailedError`
- It currently not possible to add error listeners for resend streams (i.e. when user calls `StreamrClient#resend()`)
samt1803 added a commit that referenced this pull request Jun 27, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
belimawr Tiago Queiroz
…nto nodeInspectionFlagService

* origin/NET-953-tatum-miner-framework: (29 commits)
  Refactor operator plugin (#1575)
  NET-527 maintain operator value service (#1513)
  build(deps): Bump @typescript-eslint/parser from 5.59.11 to 5.60.1 (#1603)
  build(deps): Bump @snapshot-labs/snapshot.js from 0.4.99 to 0.4.100 (#1596)
  build(deps-dev): Bump electron from 25.1.1 to 25.2.0 (#1597)
  build(deps): Bump tsyringe from 4.7.0 to 4.8.0 (#1598)
  build(deps): Bump @typescript-eslint/eslint-plugin from 5.59.11 to 5.60.0 (#1600)
  build(deps-dev): Bump nightwatch from 2.6.21 to 3.0.1 (#1601)
  build(deps-dev): Bump webpack from 5.87.0 to 5.88.0 (#1602)
  release(client, cli-tools): v8.5.4
  Docs (#1591)
  refactor(client): Remove `GapFillFailedError` (#1579)
  feat(client): Abort resends when `OrderMessages` stops (#1571)
  fix(client): Resume after gap fill error (#1570)
  test(client): Unit tests for resend subscription (#1569)
  build(deps): Bump eslint from 8.42.0 to 8.43.0 (#1560)
  build(deps): Bump commander from 10.0.1 to 11.0.0 (#1559)
  build(deps): Bump semver from 7.5.1 to 7.5.2 (#1562)
  feat(client): Informative error messages for contract call errors (#1558)
  fix(client): Error handling of `fetchHttpStream` (#1554)
  ...

# Conflicts:
#	packages/broker/.vscode/launch.json
#	packages/broker/package.json
#	packages/broker/src/plugins/operator/FakeOperatorClient.ts
#	packages/broker/src/plugins/operator/MaintainTopologyHelper.ts
#	packages/broker/src/plugins/operator/MaintainTopologyService.ts
#	packages/broker/src/plugins/operator/OperatorPlugin.ts
#	packages/broker/test/integration/plugins/operator/MaintainTopologyHelper.test.ts
#	packages/broker/test/integration/plugins/operator/MaintainTopologyService.test.ts
#	packages/broker/test/integration/plugins/operator/smartContractUtils.ts
#	packages/broker/test/unit/plugins/operator/MaintainTopologyService.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to Client Package docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants