Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEnsure documents drop when a pipeline exits #24072
Conversation
highfive
commented
Aug 27, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Aug 27, 2019
|
@bors-servo try=wpt (expected result: |
Ensure documents drop when a pipeline exits <!-- Please describe your changes on the following line: --> minimalist companion/alternative to #24047 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24072) <!-- Reviewable:end -->
|
|
Same as with #24047 |
|
@asajeffrey @jdm Ok so this is the most minimal change required to fix the leaking of window/global/document, and to be honest I have no idea why it has to do with This does leave in place the risk that we unknowingly start leaking those again due to a future change to another On the plus side it's a smaller change than the other PR, and I haven't found a way to make the other PR fit better into spec concepts. |
|
OK, this looks much much nicer than all the other approaches! It could be that if we didn't clear the performance list, then it ended up getting entries added to it but never removed, so if you quickly navigated away from the page it just sat there being a memory leak? @bors-servo r+ |
|
|
|
It's cleaner, but I'm not thrilled about not actually understanding why it works. |
Ensure documents drop when a pipeline exits <!-- Please describe your changes on the following line: --> minimalist companion/alternative to #24047 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24072) <!-- Reviewable:end -->
|
@asajeffrey theory of performance entries being added "late" in the lifecycle of the pipeline, seems plausable, actually when debugging the other PR I did run into panics where I remember being surprised this could happen, since the message handler in the script-thread does a @jdm If this could be reproduced, it could be a way to verify the "leak via performance entry that are never run" theory. |
|
Another possiblity, since performance tasks are potentially throttled by the task-queue, is that we get the following sequence:
Although I looked into this in the other PR, and set it aside because it didn't actually seem to happen while we were still leaking windows. |
|
|
|
@bors-servo retry |
|
|
Ensure documents drop when a pipeline exits <!-- Please describe your changes on the following line: --> minimalist companion/alternative to #24047 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24072) <!-- Reviewable:end -->
|
The theory of the Performance takes being kept in the task queue seems plausible. Are there other instances of tasks being kept alive even though their document has been discarded? |
|
|
|
Is this at a point where it would be worth me building and testing it? |
|
It's in master, if you can take a look that would be great! |
|
I hit a build regression on Linux I had to track down first: #24099 But it's building now and hopefully I'll have results shortly. |
|
I posted the results over in #23905. I assume that's still the right place until the fd growth issue is fully resolved? |
gterzian commentedAug 27, 2019
•
edited by SimonSapin
minimalist companion/alternative to #24047
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is