Skip to content

feat: Fail fast on collecting chunks - #1102

Open
speeddragon wants to merge 1 commit into
edgefrom
feat/fail-fast
Open

feat: Fail fast on collecting chunks#1102
speeddragon wants to merge 1 commit into
edgefrom
feat/fail-fast

Conversation

@speeddragon

@speeddragon speeddragon commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

In the current use case, a valid response when collecting chunks is when we successfully retrieve all of them. If one fails (e.g., 404, {error, _}), we should not try other chunks, because it won't change the final result.

This will reduce the latency on some transactions 5sMXXxyVQvrEGaFDxO8jnaYBBcT2vlNt1NHFatzjVes, that cannot be served due to missing chunks.

TODO:

  • Run full test suite.

@speeddragon
speeddragon marked this pull request as ready for review August 25, 2026 15:50
Comment thread src/core/util/hb_pmap.erl
Comment on lines +93 to +95
collect_until_error([], [], _Fun, _Parent, _CallRef, Results) ->
{ok, Results};
collect_until_error(Active, Remaining, Fun, Parent, CallRef, Results) ->

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be merged with collect and have the behaviour selection inside a variable, like all or until_error. But if this isn't an option via a config, I prefer the distinct functions.

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 this pull request may close these issues.

1 participant