fix(zone.js): support Timeout.refresh in Node.js#56852
fix(zone.js): support Timeout.refresh in Node.js#56852alan-agius4 wants to merge 1 commit intoangular:mainfrom
Timeout.refresh in Node.js#56852Conversation
dc69e62 to
20a2ab6
Compare
40e9877 to
9871071
Compare
edbaf45 to
e2a0f06
Compare
0b65259 to
0221ac8
Compare
0221ac8 to
97d718d
Compare
2f1c3e2 to
60a74c6
Compare
There was a problem hiding this comment.
@JiaLiPassion, can you elaborate a bit more about the need of this below checks? Why when it’s period and the state is not notScheduled the task is not removed from the tasks list?
There was a problem hiding this comment.
This is a very very old needs angular/zone.js@76c6ebf
zone.js support reschedule the task in a different zoneSpec, I believe there are some edge cases using different zoneSpecs in this way, so here the check is needed. I am not sure there are any such use cases now, if it can pass tests in g3, I think it can be removed
60a74c6 to
d5a52f3
Compare
Timeout.refresh in Node.js
d5a52f3 to
1c9cc54
Compare
The `Timeout` object in Node.js has a `refresh` method, used to restart `setTimeout`/`setInterval` timers. Before this commit, `Timeout.refresh` was not handled, leading to memory leaks when using `fetch` in Node.js. This issue arose because `undici` (the Node.js fetch implementation) uses a refreshed `setTimeout` for cleanup operations. For reference, see: https://github.com/nodejs/undici/blob/1dff4fd9b1b2cee97c5f8cf44041521a62d3f133/lib/util/timers.js#L45 Fixes: angular#56586
1c9cc54 to
827ff1b
Compare
|
Caretaker note: whilst the global presubmit is green, considering the nature of the changes, I would suggest to sync this into G3 as an individual CL. |
|
@alan-agius4 |
|
@Talb2005, glad to hear that. |
|
@alan-agius4 |
|
@Talb2005, it should be available on NPM this week. |
|
This PR was merged into the repository by commit 982f1b1. The changes were merged into the following branches: main, 18.1.x |
The `Timeout` object in Node.js has a `refresh` method, used to restart `setTimeout`/`setInterval` timers. Before this commit, `Timeout.refresh` was not handled, leading to memory leaks when using `fetch` in Node.js. This issue arose because `undici` (the Node.js fetch implementation) uses a refreshed `setTimeout` for cleanup operations. For reference, see: https://github.com/nodejs/undici/blob/1dff4fd9b1b2cee97c5f8cf44041521a62d3f133/lib/util/timers.js#L45 Fixes: #56586 PR Close #56852
|
@Talb2005, zone.js 0.14.8 has been released and contains this fix. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The
Timeoutobject in Node.js has arefreshmethod, used to restartsetTimeout/setIntervaltimers. Before this commit,Timeout.refreshwas not handled, leading to memory leaks when usingfetchin Node.js. This issue arose becauseundici(the Node.js fetch implementation) uses a refreshedsetTimeoutfor cleanup operations.For reference, see: https://github.com/nodejs/undici/blob/1dff4fd9b1b2cee97c5f8cf44041521a62d3f133/lib/util/timers.js#L45
Fixes: #56586