Hi Team,
We got a lot of exceptions due to the following exceptions on our PROD environment.
EO Nuget package version we're using:
2025.1.6```
22:40:36 Exception: Can not create additional conversion task. Please increase HtmlToPdf.MaxConcurrentTaskCount. at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Environment.get_StackTrace() at EO.Base.BaseException..ctor(String ltc, Exception ltd) at EO.Pdf.HtmlToPdfException..ctor(HtmlToPdfErrorCode ace, Int32 acf, String acg, Exception ach) at EO.Pdf.HtmlToPdfException.ispm() at EO.Internal.dpty.hkpn(mwhd bto, dptw& btp) at EO.Internal.dpub.scdw() at EO.Internal.dpub..ctor(mwhd btr, HtmlToPdfOptions bts) at EO.Pdf.HtmlToPdfSession.gvjq(HtmlToPdfOptions aaw, WebView aax) at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions aas, WebView aat, HtmlToPdfSession aau, ResourceHandler aav) at EO.Pdf.HtmlToPdfSession.Create(HtmlToPdfOptions options, ResourceHandler resourceHandler) at EO.Pdf.HtmlToPdf.ehdk(HtmlToPdfOptions adz, frtk`2 aea, Boolean aeb) at EO.Pdf.HtmlToPdf.ehdj(HtmlToPdfOptions adx, frtk`2 ady) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) at
```
We see there was an old post discussing this topic:
https://www.essentialobjects.com/forum/postst12082_HtmlToPdfMaxConcurrentTaskCount-Error.aspxAnd we confirm that we're using the default concurrent task count number (25).
The backend service in which it invokes the
`EO.Pdf.HtmlToPdf.ConvertUrl` function is using a 8 max thread pool so it's less than the 25 concurrent tasks count set by EO as default value.
After the library threw this error aggressively, it stopped working until we restarted the service.
We checked out service log and found there were 33 EO exceptions before it repeatedly throw the MaxConcurrentTaskCount exception for ALL subsequent invocations to
`EO.Pdf.HtmlToPdf.ConvertUrl`.
And 33(the exceptions we see before MaxConcurrentTaskCount failures took over) = 25(default EO max concurrent task count) + 8(our service concurrent task account).
This makes us think is it possible that the max concurrent task count somehow didn't decrease after exceptions happened.The other exceptions we see before the MaxConcurrentTaskCount exepctions are:
"Exception: WebView is closed. Reason: EngineCrash at System.Environment.GetStackTrace": 21 times.
Exception: WebView is closed. Reason: EngineCrash at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Environment.get_StackTrace() at EO.Internal.gtmo..ctor(Engine acy, String acz, Exception ada) at EO.Internal.dptv.faoi(String btb, Exception btc) at EO.Internal.dptv.faoh() at EO.Internal.dptv.hczd() at EO.Internal.dpub.scdw() at EO.Internal.dpub..ctor(mwhd btr, HtmlToPdfOptions bts) at EO.Pdf.HtmlToPdfSession.gvjq(HtmlToPdfOptions aaw, WebView aax) at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions aas, WebView aat, HtmlToPdfSession aau, ResourceHandler aav) at EO.Pdf.HtmlToPdfSession.Create(HtmlToPdfOptions options, ResourceHandler resourceHandler) at EO.Pdf.HtmlToPdf.ehdk(HtmlToPdfOptions adz, frtk`2 aea, Boolean aeb) at EO.Pdf.HtmlToPdf.ehdj(HtmlToPdfOptions adx, frtk`2 ady) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc)
`InnerException: Failed on command 4: at System.Environment.GetStackTrace`: 9 times
"The request was canceled": 2times
"Operation timed out while waiting the page to be loaded": 1 time
Based on the above observation, we have a few questions:
1. Should the task count not decrease upon exception?
2. Can you expose a public property for the current task count in later EO versions?
3. What does the Engine crash mean?
4. What would be a suggestion to help us mitigate this error?
Thanks!