Skip to content

Exit code is null when using headless chrome #16399

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ORESoftware opened this issue Oct 23, 2017 · 5 comments
Closed

Exit code is null when using headless chrome #16399

ORESoftware opened this issue Oct 23, 2017 · 5 comments
Labels
question Issues that look for answers. wrong repo Issues that should be opened in another repository.

Comments

@ORESoftware
Copy link
Contributor

ORESoftware commented Oct 23, 2017

  • Node v6
  • Darwin

I am getting a null exit code after launching and killing a child process. This probably should never happen? It's happening when I launch chrome in headless mode:

When using the 'chrome-launcher' module, everything works normally:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: []
      })
      .then(c => {

        // c.launcher.chrome is a child process instance
         c.launcher.chrome.once('exit', function(code){
          // exit code is an integer
        });

      });

but when I use headless mode:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: ['--headless']  // <<< use headless mode <<<
      })
      .then(c => {
         c.launcher.chrome.once('exit', function(code){
          // exit code is null !! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        });
      });

is this expected? I am assuming this should never happen.

@ORESoftware
Copy link
Contributor Author

I am killing chrome with a SIGINT in both cases
not sure why, but in "headed" mode, I get:

exit message => { code: 0, signal: null }

but in headless mode, I get:

exit message => { code: null, signal: 'SIGINT' }

so I guess it exits with a null code if there is a SIGINT?

@mscdex
Copy link
Contributor

mscdex commented Oct 23, 2017

I think you posted this to the wrong repo?

@mscdex mscdex added question Issues that look for answers. wrong repo Issues that should be opened in another repository. labels Oct 23, 2017
@ORESoftware
Copy link
Contributor Author

oh damn...happen to know why a child process would ever exit with a null code?

@bnoordhuis
Copy link
Member

When it's terminated by a signal. I'm guessing headless Chrome doesn't install a SIGINT handler.

@ORESoftware
Copy link
Contributor Author

ok thanks, sorry false alarm

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Issues that look for answers. wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

3 participants