NetTalk Central

Author Topic: Web Server stop responding by other Procedure  (Read 3674 times)

willieb

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Web Server stop responding by other Procedure
« on: April 09, 2018, 05:02:18 AM »
Hi,

Maybe someone can tell me what I am doing wrong.

I have a webapp and reports can be scheduled.  To make easy I create a small procedure on the main window (WebServer procedure) to run every 5min to check if there are any reports scheduled to run.  The procedure then runs the reports and add them to the email queue.

This works great but as soon as I am logged in and there is a report currently being generated and I view/refresh the table being used in the report, the "web interface" side stops working.  The app does not give an error and is stil responding to any mouse clicks on the server side, just the "web interface" side stopped working.  The report is generated successfully after a few seconds because some reports take a few seconds to calculate and generate. 

Seems like when the procedure is currently reading/updating a table and I want to "browse" the same table the system "bombs" out somewhere.  By closing and opening the app again on the server it works as normal.

What might be my problem?  I am using TPS files.

Thank  you

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Web Server stop responding by other Procedure
« Reply #1 on: April 09, 2018, 05:38:29 AM »
Hi,

My first wild guess would be:

does the small procedure on the main window start a thread. If not you might be blocking the NetWebServer with the UI.

But as i said, wild guess.

Regards
Bill

willieb

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Web Server stop responding by other Procedure
« Reply #2 on: April 09, 2018, 08:06:30 AM »
Hi Bill,

Thank You ... driving home I was thinking about this and actually realized that I have not made the procedure running on a separate thread.  Will do the change and test.

Will post the outcome after a few days of testing.

Regards

willieb

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Web Server stop responding by other Procedure
« Reply #3 on: May 10, 2018, 08:55:02 PM »
Ok, so after the change things was better. But still same issue occured just not too often.  Then finally found the issue, just do not know how to handle this.

I have some reports which is a procedure to create a excel file/report with the data requested by the user, sometimes this takes a few seconds and during that process if someone tries to do something the site will "lock up".

I could thread the excel process, but doing that will then send the link to the report before the excel process completes.  How will I "wait" for the excel process and not "lock up" the webapp when other users use the site?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: Web Server stop responding by other Procedure
« Reply #4 on: May 11, 2018, 01:30:47 AM »
Hi Willie,

>> I have some reports which is a procedure to create a excel file/report with the data requested by the user

So I presume this is not running on the "main" webserver thread? It is running on some other thread?

As noted earlier in the thread, nothing should run "on" the web server thread - you want to do everything on other threads.
Also, are you actually "using office" to create the Excel file? ie using something like say Office Inside?
Excel itself should likely only be accessed by one "process" in your app at a time. So you'd need to make that blocking so that only one "user" can access Excel at a time.

>> sometimes this takes a few seconds and during that process if someone tries to do something the site will "lock up".

This is consistent with you running the report on the main thread. But there are other possibilities as well.

cheers
Bruce


willieb

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Web Server stop responding by other Procedure
« Reply #5 on: May 11, 2018, 02:05:42 AM »
Hi Bruce,

>>So I presume this is not running on the "main" webserver thread? It is running on some other thread?

Not on the "main" webserver thread.  When a user specified all the filters and then accept the form the procedure is called to create the excel file.  Just a note, I do the same with some PDF reports.  Some PDF reports is called in source and creates the same issue where they will "lock up" the web service.  I just used the "excel report" as an example.

>>Also, are you actually "using office" to create the Excel file? ie using something like say Office Inside?

I use EasyExcel.  I have Office Inside and will use it if it will fix my issue.

>> Excel itself should likely only be accessed by one "process" in your app at a time. So you'd need to make that blocking so that only one "user" can access Excel at a time.

Until now I did not have such an issue.  (I have several web servers running on one server all creating excel reports).

Any suggestions or ideas I will gladly implement to get around this issue I am experiencing.

Thank You

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: Web Server stop responding by other Procedure
« Reply #6 on: May 16, 2018, 11:59:46 PM »
EasyOffice would be the same I think.
I would recommend serializing access so that only 1 app actually access Excel at a time.

cheers
Bruce

willieb

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Web Server stop responding by other Procedure
« Reply #7 on: May 17, 2018, 06:58:44 AM »
Hi Bruce,

I will look into it.

Even if I remove the excel reports I will still sit with the same issue with my PDF reports.

A bit more background:
I use the SV PDF template and the report procedure creates a PDF and the procedure then returns the filename which I then "serve" to the user.  This procedure which created the report also "breaks" my app when another user try to browse something.

The reason why the report procedure works like that is because I have an option where the user can "schedule" a report.  The scheduled report is the same report the user can generate when using the browser.  I have a process which then generate the scheduled report by calling the same report procedure.

Should you have any ideas please get back to me.

Thank You

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: Web Server stop responding by other Procedure
« Reply #8 on: May 24, 2018, 12:53:32 AM »
I think you need to build a demo app demonstrating the effect. Make one creating PDF files.

cheers
Bruce