asp.net mvc embedded server jsreport node.exe question

314 views
Skip to first unread message

Darshan Joshi

unread,
Jan 2, 2015, 12:57:06 AM1/2/15
to jsre...@googlegroups.com
Hi,

I have asked a question at stackoverflow: 

can you please help me with this?

thanks.

Note: I have also created an Issue on github, which I will be closing.


Jan Blaha

unread,
Jan 2, 2015, 4:31:47 AM1/2/15
to jsre...@googlegroups.com
Let's try to discuss it here first and later paste final answer to the SO.

- three node.js running processes is normal state at this moment. There is a master process which recycles child when there is an error or timeout in the report rendering. This is because jsreport can also serve potentially dangerous requests which would end in the infinite loop for example.

- node.exe process life cycle should mirror your application life cycle. When your application pool shuts down, it should also exit. This is happening in iis by default after 15 minutes of inactivity I think. Then when the first request to your website comes, it should hit Application_Start where you have probably the code starting EmbeddedReportingServer. Then everything should be online and able to convert view to pdf.

When the node.exe shuts down, is it because app pull shut down or is there any special condition when this happens? Do you have debugger attached to the iis at this time?

Darshan Joshi

unread,
Jan 2, 2015, 4:42:20 AM1/2/15
to jsre...@googlegroups.com
Hi,

OK. so good for three processes. thanks on that.

I believe, the node.exe has an independent life span. .e.g "prod.config.json" file has an extention "selfTerminate" and
 "phantom": {
       
"numberOfWorkers" : 1,
       
"timeout": 180000
   
},

Can that cause node.exe to exit? I have all three exes exiting.

And, No, I do not have debugger attached to it.

Jan Blaha

unread,
Jan 2, 2015, 5:33:26 AM1/2/15
to
phantom.timeout in config defines the timeout for rendering pdf inside phantom.exe. After this time it will recycle phantom.exe but there should be no affect for the parent node process.

selfTerminate extension is there for cleaning node.exe orphans but it shouldn't be active when running without debugger. When the .net process is running without debugger it is easy to handle process exit and kill node.exe processes. The selfTerminate isn't therefore needed. However when debugger is attached to the .net process there is no way to handle exit event. Therefore when in debug, .net process is pinging jsreport and when the debugger stops, pinging ends and jsreport will "selfTerminate" itself to avoid node.exe process orphans.

Your extracted jsreport should be inside App_Data, can you please check the package.json file in there? There should be "version" attribute inside with value 0.2.3 I think.

Is the node.exe exiting during the report rendering? Or is it after the same time after the start every time?

Darshan Joshi

unread,
Jan 2, 2015, 5:40:52 AM1/2/15
to jsre...@googlegroups.com
Thanks for excellent clarification.

Yes. version is 0.2.3.
 "name": "jsreport",
  "version": "0.2.3",
  "author": {
    "name": "Jan Blaha",
 

it is second scenario: node.exe exits after some time after start everytime.  

Jan Blaha

unread,
Jan 2, 2015, 11:40:46 AM1/2/15
to jsre...@googlegroups.com
No matter what I do it still works for me. Classic cliche. Let's try to limit the scope of possible reasons.

- make sure you have something like this in your Global.asax#Application_Start
EmbeddedReportingServer = new EmbeddedReportingServer() { RelativePathToServer = "../App_Data" };
EmbeddedReportingServer.StartAsync().Wait();
It is important to set RelativePathToServer so the server does not run from the bin folder. Also it is important to wait starting so the first request is server correctly.

- please estimate elapsed time from the start to the node.exe exit
30 seconds is the default timeout for selfTerminate. It should not be applied but still maybe it things it is running under debug
20 minutes is default timeout for IIS app pool idle recycle. It should start again anyway after first request, but maybe it does not

- is this happening also when running during development on your iisexpress? Is there a difference between debug F5 and non debug CTRL+F5 ?

Reply all
Reply to author
Forward
0 new messages