Page MenuHomePhabricator

D21466.id51094.diff
No OneTemporary

D21466.id51094.diff

diff --git a/src/future/FutureIterator.php b/src/future/FutureIterator.php
--- a/src/future/FutureIterator.php
+++ b/src/future/FutureIterator.php
@@ -194,7 +194,14 @@
* @task iterator
*/
public function next() {
- $this->key = null;
+ // See T13572. If we preivously resolved and returned a Future, release
+ // it now. This prevents us from holding Futures indefinitely when callers
+ // like FuturePool build long-lived iterators and keep adding new Futures
+ // to them.
+ if ($this->key !== null) {
+ unset($this->futures[$this->key]);
+ $this->key = null;
+ }
$this->updateWorkingSet();

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 28, 3:44 PM (6 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7723850
Default Alt Text
D21466.id51094.diff (645 B)

Event Timeline