mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Restore hard-fail mode
This commit is contained in:
parent
36b8f63984
commit
ce603a06b7
1 changed files with 11 additions and 0 deletions
|
@ -26,6 +26,8 @@ use servo_util::url::parse_url;
|
||||||
use servo_util::task::spawn_named;
|
use servo_util::task::spawn_named;
|
||||||
use std::hashmap::{HashMap, HashSet};
|
use std::hashmap::{HashMap, HashSet};
|
||||||
use std::util::replace;
|
use std::util::replace;
|
||||||
|
use std::io;
|
||||||
|
use std::libc;
|
||||||
|
|
||||||
/// Maintains the pipelines and navigation context and grants permission to composite
|
/// Maintains the pipelines and navigation context and grants permission to composite
|
||||||
pub struct Constellation {
|
pub struct Constellation {
|
||||||
|
@ -384,6 +386,15 @@ impl Constellation {
|
||||||
fn handle_failure_msg(&mut self, pipeline_id: PipelineId, subpage_id: Option<SubpageId>) {
|
fn handle_failure_msg(&mut self, pipeline_id: PipelineId, subpage_id: Option<SubpageId>) {
|
||||||
debug!("handling failure message from pipeline {:?}, {:?}", pipeline_id, subpage_id);
|
debug!("handling failure message from pipeline {:?}, {:?}", pipeline_id, subpage_id);
|
||||||
|
|
||||||
|
if self.opts.hard_fail {
|
||||||
|
// It's quite difficult to make Servo exit cleanly if some tasks have failed.
|
||||||
|
// Hard fail exists for test runners so we crash and that's good enough.
|
||||||
|
let mut stderr = io::stderr();
|
||||||
|
stderr.write_str("Pipeline failed in hard-fail mode. Crashing!\n");
|
||||||
|
stderr.flush();
|
||||||
|
unsafe { libc::exit(1); }
|
||||||
|
}
|
||||||
|
|
||||||
let old_pipeline = match self.pipelines.find(&pipeline_id) {
|
let old_pipeline = match self.pipelines.find(&pipeline_id) {
|
||||||
None => return, // already failed?
|
None => return, // already failed?
|
||||||
Some(id) => *id
|
Some(id) => *id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue