Skip to content

Conversation

@a-robinson
Copy link
Member

As discussed, the workers runtime already handles closing outgoing connections as soon as a worker invocation finishes. And we have reason to believe that sql.end() can cause hangs due to a bug in postgres.js (porsager/postgres#1097), so it's better to just not include it.

I guess I didn't have to remove it from our node-postgres examples, but it isn't needed there either, so why clutter our examples with extra code?

@thomasgauvin @ReppCodes

As discussed, the workers runtime already handles closing outgoing
connections as soon as a worker invocation finishes. And we have reason
to believe that sql.end() can cause hangs due to a bug in postgres.js,
so it's better to just not include it.

I guess I didn't have to remove it from our node-postgres examples, but
it isn't needed there either, so why clutter our examples with extra
code?
Copy link
Contributor

@ReppCodes ReppCodes left a comment

Choose a reason for hiding this comment

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

Thanks, Alex!

@a-robinson a-robinson merged commit 4f9753b into cloudflare:production Aug 15, 2025
5 checks passed
thomasgauvin pushed a commit that referenced this pull request Aug 15, 2025
As discussed, the workers runtime already handles closing outgoing
connections as soon as a worker invocation finishes. And we have reason
to believe that sql.end() can cause hangs due to a bug in postgres.js,
so it's better to just not include it.

I guess I didn't have to remove it from our node-postgres examples, but
it isn't needed there either, so why clutter our examples with extra
code?
maxvp pushed a commit that referenced this pull request Aug 24, 2025
As discussed, the workers runtime already handles closing outgoing
connections as soon as a worker invocation finishes. And we have reason
to believe that sql.end() can cause hangs due to a bug in postgres.js,
so it's better to just not include it.

I guess I didn't have to remove it from our node-postgres examples, but
it isn't needed there either, so why clutter our examples with extra
code?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.