Welcome Guest Search | Active Topics | Sign In | Register

Maximum number of session reached on calling HtmlToPdf.ConvertUrl(url, file) in a loop Options
Charles Okwuagwu
Posted: Tuesday, October 23, 2012 4:37:25 AM
Rank: Newbie
Groups: Member

Joined: 8/1/2007
Posts: 5
System.Exception: Maximum number of session reached.
at EO.Pdf.Internal.lo.c.a(hi A_0)
at EO.Pdf.Internal.lo.c.a(Byte[] A_0)

I am calling HtmlToPdf.ConvertUrl(url, file) in a loop to generate a list of reports.

this is a new error after upgrading to 4.0.36.2
eo_support
Posted: Tuesday, October 23, 2012 7:38:04 AM
Rank: Administration
Groups: Administration

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

This can happen when you call the converter this way. Try to add a slight time delay between the calls and see if it resolves the problem for you.

Thanks!
Simon Scheurer
Posted: Wednesday, August 14, 2013 1:57:32 AM
Rank: Advanced Member
Groups: Member

Joined: 5/14/2013
Posts: 45
Hi,

We run into the same error. We are processing close to 250'000 renditions in 4 parallel threads. The issue appears after having created 30 to 40 renditions.

Sorry to say so, but "This can happen when you call the converter this way. Try to add a slight time delay between the calls and see if it resolves the problem for you." is not really an answer.

Question one: What does "when you call the converter this way" mean. What other options should be there?
Question two: How much should such a "delay" be and how does it relates to parallelity? I thought that by setting the MaximumParallelConversion option and not exceeding it, everything should be fine?
Why do you need that and are not able to synchronize internally until resources are available? Addind a delay is a shaky way of solving a parallelity issue in a production system.

Note: We set MaximumParallelConversion to 8 (we have 4 threads) and use the HtmlToPdf.ConvertHtml option (not ConvertUrl).
Simon Scheurer
Posted: Wednesday, August 14, 2013 1:58:03 AM
Rank: Advanced Member
Groups: Member

Joined: 5/14/2013
Posts: 45
P.S. We use the newest build from EO, not 4.0.36.2
eo_support
Posted: Wednesday, August 14, 2013 9:12:25 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi Simon,

The original reply doesn't apply to the current version. In the original reply "call the converter this way" means calling it a loop, which was a bug on our side and I believe it has already been fixed.

Your understanding about MaxConcurrentTaskCount and thread is correct. However it appears that you have some kind of wrapper around our code (as you call it MaximumParallelConversion instead of MaxConcurrentTaskCount). So you may want to try to reproduce the problem in a separate test project without any of your additional code. If the problem still happens, you can send the project to us and we will be happy to investigate further.

Thanks!
Simon Scheurer
Posted: Wednesday, August 14, 2013 9:15:29 AM
Rank: Advanced Member
Groups: Member

Joined: 5/14/2013
Posts: 45
Hi,

it's quite interesting: Actually the exception is thrown and catched insided the EO.PDF library. It does not throw in our code. It seems to me, that although it throws internally the rendition created is actually fine. I just 'see' the Exception if I ran in debug mode and have Exceptions break the code in VS 2012.

I'll need to investigate further if the renditions are truly fine or whether something is missing on the page.
No more investigation needed here from your side. If I find out something additional, I'll post it.

Best regards,

Simon
eo_support
Posted: Wednesday, August 14, 2013 9:28:00 AM
Rank: Administration
Groups: Administration

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

That's normal. We do throw that exception repeatedly internally and we properly handle it. It does not indicate any problem.

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.