-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
The time allocated for FrameManager to initialize is not enough (1 second) #2622
Comments
@AleksandrsJakovlevsVisma Are you willing to test some custom build to confirm the fix? |
@kblok Sorry for the delay, I was on vacation. Yes, I don't mind trying a custom build |
@AleksandrsJakovlevsVisma I'm exposing the TaskHelper timeout here. Can you see if increasing the timeout there helps? That's an static class that will affect the entire library. |
@kblok I did the following:
|
Good catch
That would be something on your side right? |
Thank you for helping out with this one. It is the problem on our side, yes. The PDF conversion on average takes 6 seconds, but the request times out after a minute. 200 requests with a max count of simultaneously opened pages = 10 is not enough to make sure each of 200 finishes in a minute. Do you have any advice on how to speed up a simple HTML to PDF conversion? Perhaps there are some magic LaunchOptions args? In any case, can we expect the configurable default timeout released in the near future? |
PDF generate is quite resource intensive. If you look at the code, most of the time is on the browser side.
I can ship it today :) |
Nice, we will look forward to it, whenever you'll have the time :) |
Description
We are trying to use Puppeteer-Shart to convert HTML to PDF. Sometimes we could get 200 conversion requests simultaneously. At first, we tried to create a browser and a page for each request but quickly realized that this was a bad idea performance-wise. Our new strategy is to use a pool of pages which means we always use one browser and allow a maximum of 10 pages to be opened.
Still, it does not work. At some point, when a new page is created, we get this exception:
PuppeteerSharp.TargetClosedException: Protocol error (Performance.enable): Session closed. Most likely the Page has been closed.Close reason: Connection failed to process Page.frameStoppedLoading. Timeout of 1000 ms exceeded.
Coupled with stuff like this:
PuppeteerSharp.TargetClosedException: Protocol error(Target.createTarget): Target closed. (Connection failed to process {\""id\"":14,\""result\"":{},\""sessionId\"":\""BED668EF013F206DE76E55157C4B06BC\""}. Object reference not set to an instance of an object.
Reading the code I guess the following is happening:
Complete minimal example reproducing the issue
This is an approximation of what the pool looks like. Calling GetPageAsync in multiple threads will eventually lead to the above-mentioned exceptions.
Expected behavior:
All 200 requests successfully convert HTML to PDF
Actual behavior:
At some point conversion fails
Versions
The text was updated successfully, but these errors were encountered: