Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF and more determinate control over the engine and worker process Options
Dylan Moonfire
Posted: Wednesday, October 7, 2020 5:42:12 PM
Rank: Newbie
Groups: Member

Joined: 10/7/2020
Posts: 1
Recently, we've had a spate of difficulties with EO.PDF in our development and QA environments. In specific, the PDF process seems to be hanging and we have to either manually kill it or it fails the test because we are running a couple hundred of them in a single process (~200 tests deal with testing PDF generation, usually run 4-8 at a time).

At other times, the first call to EO.PDF hangs for a while before dying with the image manager error.

We tried the worker process, but then the `eowp.exe` process is still hanging around when we use a CI server to deploy to the site which causes a "file in use" problem which then causes difficulties with the deployment process. Plus, it doesn't always fix the image manager exception (but frequently does). This also causes some problem with ReSharper's test running because there is an errant `eowp.exe` process still running after the tests finish which then ReSharper asks to shut down.

I'm not sure the cause, but I was thinking about changing how we use EO.PDF from the static `HtmlToPdf` calls to something that was thread-specific and controlled in the scope of a test. Originally, I thought creating an Engine with a dedicated directory that I could setup and tear down as needed would work but I couldn't figure out how to get `HtmlToPdf` to use the engine.

Am I missing something or is there something I can do to have more control over the worker process in a multi-threaded process?

Thank you.
eo_support
Posted: Thursday, October 8, 2020 11:27:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,068
Hi,

Please try to update to the latest build. We did fix some issues that can cause the engine to hang in the past. So the new build might resolve the issue for you.

As to eowp.exe, you can call this method when you are done:

https://www.essentialobjects.com/doc/eo.base.runtime.shutdown.aspx

This method will explicitly close the remaining eowp.exe started by your process. If you can only call this method from a separate process, use code like this:

Code: C#
PdfDocument doc = new PdfDocument();
doc.Save(new MemoryStream());
EO.Base.Runtime.Shutdown();


Because some eowp.exe processes are shared, the first two lines are used to "connect" to the shared eowp.exe, which will allow the third line to shut it down.

Threading should not matter for the HTML to PDF conversion engine. It is designed to be used in a multi-thread environment.

Hope this helps.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.