Skip to content

Commit

Permalink
Auto merge of #18853 - asajeffrey:constellation-chaos-monkey-dont-kil…
Browse files Browse the repository at this point in the history
…l-pending-pipelines, r=jdm

Random pipeline closure is less likely to kill pending pipelines.

<!-- Please describe your changes on the following line: -->

Make it less likely for pending pipelines to be randomly killed. Pending pipelines send more messages to the constellation, so at the moment we're skewing to killing pipelines early in their lifetimes.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18852
- [X] These changes do not require tests because it's fixing test infrastructure

<!-- 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/18853)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Oct 12, 2017
2 parents 8171a5f + 70ce468 commit 8830f62
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/constellation/constellation.rs
Expand Up @@ -2902,12 +2902,21 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// In order to get repeatability, we sort the pipeline ids.
let mut pipeline_ids: Vec<&PipelineId> = self.pipelines.keys().collect();
pipeline_ids.sort();
if let Some((ref mut rng, _)) = self.random_pipeline_closure {
if let Some((ref mut rng, probability)) = self.random_pipeline_closure {
if let Some(pipeline_id) = rng.choose(&*pipeline_ids) {
if let Some(pipeline) = self.pipelines.get(pipeline_id) {
// Don't kill the mozbrowser pipeline
if PREFS.is_mozbrowser_enabled() && pipeline.parent_info.is_none() {
info!("Not closing mozbrowser pipeline {}.", pipeline_id);
} else if
self.pending_changes.iter().any(|change| change.new_pipeline_id == pipeline.id) &&
probability <= rng.gen::<f32>()
{
// We tend not to close pending pipelines, as that almost always
// results in pipelines being closed early in their lifecycle,
// and not stressing the constellation as much.
// https://github.com/servo/servo/issues/18852
info!("Not closing pending pipeline {}.", pipeline_id);
} else {
// Note that we deliberately do not do any of the tidying up
// associated with closing a pipeline. The constellation should cope!
Expand Down

0 comments on commit 8830f62

Please sign in to comment.