Fix memory leak by removing custom net/tls polyfills#1109
Fix memory leak by removing custom net/tls polyfills#1109astralhpi wants to merge 4 commits intoporsager:masterfrom
Conversation
Cloudflare Workers now provide built-in net and tls polyfills, making custom polyfills unnecessary and fixing memory leaks caused by the previous Socket polyfill implementation.
4a0fe34 to
3a43815
Compare
|
Fantastic ! Do you have any idea for running the tests for Cloudflare Workers too? |
|
Unfortunately, automated memory leak testing in Workers is difficult - profiling requires manual Chrome DevTools inspection via Wrangler dev, and production workers auto-respawn on crash. |
|
Hi, I think I need this. I have logs of multiple CF queue handlers which did nothing except having a postgres.js connection open (just waited for the answer (that never came) of an RPC call for 8.4 minutes, using 10ms CPU time) and then died with OOM ( It literally makes no sense at all, and this is my only possible explanation/fix that's not completely out there. Is there any way to preview this/could it be merged? |
Problem
Custom Socket polyfill implementation was causing memory leaks in Cloudflare Workers environments.
Solution
Removed custom net/tls polyfills since Cloudflare Workers now provide built-in polyfills for these modules.
Changes
Result
Reproducer: https://github.com/astralhpi/cf-worker-memory-leak-sample