Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15437043
D21466.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
645 B
Referenced Files
None
Subscribers
None
D21466.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 5:09 PM (3 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7723850
Default Alt Text
D21466.diff (645 B)
Attached To
Mode
D21466: Fix a slow memory leak in long-lived FutureIterator objects, as used by FuturePool
Attached
Detach File
Event Timeline
Log In to Comment