Skip to content

webhooks: order is not guaranteed on rapidly generated requests to same end point. #135

Open
@GaryAustin1

Description

@GaryAustin1

Improve documentation

I suggest adding a note in the docs that for rapidly generated requests order of the http requests at the endpoint is not guaranteed.

Based on observation testing realtime broadcast endpoint and bulk inserts the requests arrive out of order at the endpoint. I assume this is because the actual http request generated by pg_net does not wait for a response before sending the next request. With http there is no guarantee the requests will arrive in order especially with a very short time span between them.

The lack of order was observed both with realtime endpoint and a webhook service endpoint.

The sequence generating the order issue is a bulk insert

insert into cats (count)
select * from generate_series (2300,2350)

The trigger function calls pg_net per row.

Note: It would be useful to have a mode where pg_net would be "sync" on the http side. It could wait for response before sending next response (especially if url is same). It will still be async on the SQL caller side so different that the http extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions