Skip to content

Conversation

@speeddragon
Copy link

Issue

When set <<"parallel">> => true in a route, the request will return 404 Not Found, because an error occurred in the code.

Example:

            #{
                % Routes for GraphQL requests to use a remote GraphQL API.
                <<"template">> => <<"/graphql">>,
                <<"parallel">> => true,
                <<"nodes">> =>
                    [
                        #{
                            <<"prefix">> => <<"https://ao-search-gateway.goldsky.com">>,
                            <<"opts">> => #{ http_client => httpc, protocol => http2 }
                        },
                        #{
                            <<"prefix">> => <<"https://arweave-search.goldsky.com">>,
                            <<"opts">> => #{ http_client => httpc, protocol => http2 }
                        },
                        #{
                            <<"prefix">> => <<"https://arweave.net">>,
                            <<"opts">> => #{ http_client => gun, protocol => http2 }
                        }
                    ]
            },

Related pull requests

@speeddragon speeddragon changed the base branch from main to edge December 31, 2025 16:16
src/hb_http.erl Outdated
}
],
hb_store:reset(Store),
Opts = #{store => Store},
Copy link
Author

Choose a reason for hiding this comment

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

Set Routes here, will not have an impact how parallel property if obtained, because if not present in the Store configuration, it will be fetched from hb_opts:default_message.

Comment on lines +244 to +256
parallel_responses(Res, [], Ref, _Awaiting, _StopAfter, _Admissible, _Statuses, _Opts) ->
empty_inbox(Ref),
Res;
Copy link
Author

Choose a reason for hiding this comment

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

This is part of a new commit that fixes timeout issues. Accessing http://localhost:8734/0-4Bfb-Mjr-JTvHSAiXOGajNzf60x7ZwxB0_95tJ_KI makes every GraphQL API return an empty response.

This makes is_admissible function to return false, and removes that process from the list. Since the condition here is always for Awaiting request to match 0, it will be waiting forever in the receive because there isn't a timeout there as well.

We can add a timeout in the future, mainly because it would be a "catch all" in case something goes wrong. For this case, it should cover all scenarios, and if a request takes too long to reply, the HTTP request has a timeout to return.

@jfrain99 jfrain99 force-pushed the fix/parallel_requests branch from da00446 to 814ce18 Compare January 28, 2026 15:50
@jfrain99 jfrain99 merged commit c1b2b78 into edge Jan 28, 2026
@jfrain99 jfrain99 deleted the fix/parallel_requests branch January 28, 2026 17:07
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.

3 participants