Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ISAPI dll hangs when Terminate AFTER QExport4XLS.Execute
#1
Delphi 10.2.3
IW 14.2.6

After migrating from IW10, our ISAPI dll is hanging after user exports a report to XLS (via EMS Advanced Data Export 4.16.0.2) and then terminates the session or TimeOut happen. Both events trigger a TerminateAndRedirect. No new users can log into the application and this problem is only resolved doing a recycle in IIS. We have tried everything possible and find no reason of this behaviour. This app had been working fine for years. The problem does not appear if running as exe, only as dll with IIS. We even tried going all the way to IW 15.2.20, same thing happens. Any help would be greatly appreciated. 

UPDATE. We also use Templates in this app. Since the form that produces this report allows download of xls (via SendFile) Form LockOnSubmit is set to False.
Yesterday in one of our trial & error tests, we took the template of that form out and the error seemed to go away, but NO, it continues Sad

UPDATE 2. We moved the QExport component from the UserSessionUnit where it originally was to the unit where the user generates the export. When the user exits that form after generating the XLS export the session of the user hangs, but the other logged in users can continue to work. When leaving the form there is a Form.Release, and there the session hangs. It seems that QExport component leaves something open that Intraweb cannot dispose of.

UPDATE 3. EMS, the makers of the component, say that it is not a problem of component, but something that IW is not able to handle. We are out of options. 

Can you help us understand the problem and -most important - how to find the culprit and solve it?
 
Best regards.
Reply
#2
I will need more information.

I never used this component myself and trying to get any documentation regarding it took me to some dodgy web sites. Can you point me the documentation?
Reply
#3
(06-16-2021, 06:45 AM)Alexandre Machado Wrote: I will need more information.

I never used this component myself and trying to get any documentation regarding it took me to some dodgy web sites. Can you point me the documentation?


Sure: https://download.sqlmanager.net/download...export.pdf
Thanks for looking into this. This issue is driving us crazy.
Best regards!
Alex
Reply
#4
Off hand, it sounds very much like this component has threading issues. If so the best way may be to use a separate process for each export. We have a demo/component for components like this that arent written properly for threads.
Reply
#5
(06-16-2021, 05:18 PM)kudzu Wrote: Off hand, it sounds very much like this component has threading issues. If so the best way may be to use a separate process for each export. We have a demo/component for components like this that arent written properly for threads.

Thank you very much, that is what we think, too. When testing with multi-user, when one user exported and hanged the system, when other user requested another xls report, this action allowed the other session to exit the hang!!

Can you please point me to the demo project on how to deal with such components?
Best regards,
Alex
Reply
#6
(06-16-2021, 05:18 PM)kudzu Wrote: Off hand, it sounds very much like this component has threading issues. If so the best way may be to use a separate process for each export. We have a demo/component for components like this that arent written properly for threads.

I'm sure Chad is talking about CGIRunner.   This should solve threading issues.   That said, I believe it was introduced in a v15 update (can't remember).

The component makes it trivial to place a portion of your code into a CGI app and call it from an IW session.  The CGI app can run unmolested by other threads.

Dan
Reply
#7
Hi, this is the demo: https://github.com/Atozed/IntraWeb/tree/.../CGIRunner Chad and Dan commented.
Reply
#8
(06-16-2021, 06:43 PM)DanBarclay Wrote:
(06-16-2021, 05:18 PM)kudzu Wrote: Off hand, it sounds very much like this component has threading issues. If so the best way may be to use a separate process for each export. We have a demo/component for components like this that arent written properly for threads.

I'm sure Chad is talking about CGIRunner.   This should solve threading issues.   That said, I believe it was introduced in a v15 update (can't remember).

The component makes it trivial to place a portion of your code into a CGI app and call it from an IW session.  The CGI app can run unmolested by other threads.

Dan

Thank you very much. Sorry to respond after so much time, had health issues.
We resolved that part, however, the main problem, as Alexandre pointed out, is the component that has threading issues.
Reply
#9
(08-04-2021, 08:03 PM)alex.trejo@tttnet.com.mx Wrote:
(06-16-2021, 06:43 PM)DanBarclay Wrote:
(06-16-2021, 05:18 PM)kudzu Wrote: Off hand, it sounds very much like this component has threading issues. If so the best way may be to use a separate process for each export. We have a demo/component for components like this that arent written properly for threads.

I'm sure Chad is talking about CGIRunner.   This should solve threading issues.   That said, I believe it was introduced in a v15 update (can't remember).

The component makes it trivial to place a portion of your code into a CGI app and call it from an IW session.  The CGI app can run unmolested by other threads.

Dan

Thank you very much. Sorry to respond after so much time, had health issues.
We resolved that part, however, the main problem, as Alexandre pointed out, is the component that has threading issues.

Threading issues would be a reason to create a CGI.

If this is a non visual component that can be put in a CGI then it should take care of your threading issues.  The CGI should have a thread of its own.

Dan
Reply
#10
The component spawns new threads to interact with the UI.

Also part of the code was not thread safe. I modified the component code to make it thread-safe and be able to run smoothly in IntraWeb servers (seems that the component writer doesn't have time to do that). I'll publish the patch of the component in our Github repo, so other developers using it can also benefit from the fix.

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)