-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aborting PDF render doesn't stop chromium immediately #1505
Comments
I have the same problem |
I don't think you are aborting the pdf render, you are rather aborting the navigation. So as I read it, you are expecting pending requests such as goto to throw upon page.close(). |
That's correct. As I indicated at the end of the "What is the expected result?" section, the issue persists when aborting the render too. |
Here's a slightly shorter snippet that reproduces the issue without instructing the browser to render a PDF: const puppeteer = require('puppeteer') // v0.13.0
const URL = 'https://en.wikipedia.org/api/rest_v1/page/html/Maybeshewill'
function gotoAndClose(browser) {
browser.newPage()
.then((page) => {
console.log(`page#goto(${URL})`)
// Defer closing the page so that navigation can start.
process.nextTick(() => {
console.log('page#close()')
page.close()
.then(() => {
console.log('browser#close()')
// Close the browser so that the Node.js process can
// exit.
browser.close()
})
})
return page.goto(URL, {
timeout: 5000,
waitUntil: 'networkidle2'
})
})
.catch((error) => console.log('Error: ', error))
}
puppeteer.launch()
.then(gotoAndClose) which yields the following output:
AFAICT this is an issue with the |
@aslushnikov - are there any plans to work on this issue? We also noticed that if we start the PDF render and then, for example, kill the Chromium instance manually - the puppeteer instance is not being notified about chromium unavailability. It keeps waiting for the response, and then after {puppeteer_options.timeout} seconds it timeouts with: |
@polishdeveloper we have a huge backlog of features to work on. We prioritize first "most wanted" features/issues, and we figure the demand from amount of "likes" on the issue. Given this, this bug is a low-pri for us. |
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days. |
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it! |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
I'd like to abort a PDF render, but puppetteer doesn't abort immediately after closing the page and browser instances used in rendering the PDF. Here's the snippet of code that I'm using for testing:
What is the expected result?
I should see the following text in the console. Italicized text is my comment.
_1. opening a new page
_2. visiting the url
closing the page
closing the browser
_4. Some kind of an error about the closed page or browser instance should be thrown immediately without waiting for timeout. It's true that I'm aborting the process in
page.goto
step, but aborting in any other step after creating a puppeteer instance results in the same issue: the chromium process doesn't stop immediately, rather it does what it's doing and then finish when it's done.What happens instead?
_1. opening a new page
_2. visiting the url
closing the page
closing the browser
(about 5 second wait happens here)
_4. error Error: Navigation Timeout Exceeded: 5000ms exceeded
at Promise.then (/home/bmansurov/workspace/mediawiki-services/chromium-render/node_modules/puppeteer/lib/NavigatorWatcher.js:69:21)
at
(node:22758) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Navigation Timeout Exceeded: 5000ms exceeded
(node:22758) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered: