Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-12 Thread alainm
That application is very old, in asp classic and badly written. The page 
was aborting because of an error sending the email. Implementing a 
try-catch (it's equivalent in asp) solved the problem. But to make sure 
that tje message


Enviado através do AquaMail para Android
http://www.aqua-mail.com


A 12 de agosto de 2015 18:11:00 Moacir Braga cont...@moacirbrg.org escreveu:


Hi Alain, your answer makes me happy because if Mandrill is the problem,
many things will make sense to me, but I need to ask you something.

The problem you mentioned before was a completely hanging up server?
I didn't understand very well your comment 10 retries as 30s interval.
Why did you decided to implement this solution? Analyzing your comment I
understood that Mandrill is entering in a infinite loop and blocking the
main process.

On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:

 It’s been a few weeks since I started trying to solve this problem, but I
 still haven’t figured out a possible solution. The issue is that my server
 accepts requests and responds to them normally in the beginning. However,
 after an unknown event happens (I’m still trying to discover which event it
 is), the server continues accepting requests, but it stops responding to
 them.



 I’ve already checked the Process Monitor (the server is running on Windows
 Server 2012 R2) and I could notice that when this problem happens, new
 requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a
 Disconnect.



 I tried to execute the server in debug mode, but then again, when this
 problem happens the debugger does not work and it hangs up as well.



 The server doesn’t explode and no errors occur. Thus, domains won’t help
 me in this case. I’ve tried to handle uncaughtException, but it also didn’t
 work.



 The server keeps running without using excessive processor or memory
 resources. Its behavior is still similar to the one during the first
 execution, except for the fact that it’s not responding as it was before.



 When I sent a SIGNAL via console, the server simply started working
 normally again without restarting or anything. It just got back to normal.



 I tried to execute a lot of requests using ApacheBench and NeoLoad, but I
 just can’t reproduce this problem. It simply happens randomly.



 The socket has a timeout of two minutes. However, the server keeps hanging
 up the requests for hours.



 When I sent the SIGNAL mentioned before, all requests that were hanging
 were executed, as if they were in a queue waiting for the last request to
 be finished.



 I don’t know what else could I do to find out what is causing this problem.


 I'm using Node.js + Express + body-parser + cookie-parser + Windows
 Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.


 *If somebody has any idea of what is causing the server to hang up
 forever, please tell me.*


 Best Regards,

 *Moacir Braga*


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

---
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to nodejs+unsubscr...@googlegroups.com.

To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/afac9a62-d246-4a27-b2fc-bd800165d986%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups nodejs group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/14f23c85a28.2782.962c06d43ba9274da034cf7d02472879%40bonseletrons.com.br.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-12 Thread alainm

Sorry, truncated...

So... To make sure that the message doesn't get lost, I implemented a retry.

My diagnose is that the problem was with the connection and not properly 
with Mandrill




Enviado através do AquaMail para Android
http://www.aqua-mail.com


A 12 de agosto de 2015 18:11:00 Moacir Braga cont...@moacirbrg.org escreveu:


Hi Alain, your answer makes me happy because if Mandrill is the problem,
many things will make sense to me, but I need to ask you something.

The problem you mentioned before was a completely hanging up server?
I didn't understand very well your comment 10 retries as 30s interval.
Why did you decided to implement this solution? Analyzing your comment I
understood that Mandrill is entering in a infinite loop and blocking the
main process.

On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:

 It’s been a few weeks since I started trying to solve this problem, but I
 still haven’t figured out a possible solution. The issue is that my server
 accepts requests and responds to them normally in the beginning. However,
 after an unknown event happens (I’m still trying to discover which event it
 is), the server continues accepting requests, but it stops responding to
 them.



 I’ve already checked the Process Monitor (the server is running on Windows
 Server 2012 R2) and I could notice that when this problem happens, new
 requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a
 Disconnect.



 I tried to execute the server in debug mode, but then again, when this
 problem happens the debugger does not work and it hangs up as well.



 The server doesn’t explode and no errors occur. Thus, domains won’t help
 me in this case. I’ve tried to handle uncaughtException, but it also didn’t
 work.



 The server keeps running without using excessive processor or memory
 resources. Its behavior is still similar to the one during the first
 execution, except for the fact that it’s not responding as it was before.



 When I sent a SIGNAL via console, the server simply started working
 normally again without restarting or anything. It just got back to normal.



 I tried to execute a lot of requests using ApacheBench and NeoLoad, but I
 just can’t reproduce this problem. It simply happens randomly.



 The socket has a timeout of two minutes. However, the server keeps hanging
 up the requests for hours.



 When I sent the SIGNAL mentioned before, all requests that were hanging
 were executed, as if they were in a queue waiting for the last request to
 be finished.



 I don’t know what else could I do to find out what is causing this problem.


 I'm using Node.js + Express + body-parser + cookie-parser + Windows
 Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.


 *If somebody has any idea of what is causing the server to hang up
 forever, please tell me.*


 Best Regards,

 *Moacir Braga*


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

---
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to nodejs+unsubscr...@googlegroups.com.

To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/afac9a62-d246-4a27-b2fc-bd800165d986%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups nodejs group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/14f23cb53e0.2782.962c06d43ba9274da034cf7d02472879%40bonseletrons.com.br.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-12 Thread Alain Mouette
That application is very old, in asp classic and badly written. The page 
was aborting because of an error sending the email. Implementing a 
try-catch (it's equivalent in asp) solved the problem.
But to make sure that the message doesn't get lost, I implemented a 
retry, it waits 3s each time and repeats 10 times for a total os 30 seconds.


My diagnose is that the problem was with the connection and not properly 
with Mandrill.


(may previous email gos truncated and uplicated and never got to the 
list, so this is a consolidated version)


Alain Mouette
=== Projetos especiais: http://lnkd.in/dEu8cNq ===

Em 12-08-2015 18:04, Moacir Braga escreveu:
Hi Alain, your answer makes me happy because if Mandrill is the 
problem, many things will make sense to me, but I need to ask you 
something.


The problem you mentioned before was a completely hanging up server?
I didn't understand very well your comment 10 retries as 30s 
interval. Why did you decided to implement this solution? Analyzing 
your comment I understood that Mandrill is entering in a infinite loop 
and blocking the main process.


On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:

It’s been a few weeks since I started trying to solve this
problem, but I still haven’t figured out a possible solution. The
issue is that my server accepts requests and responds to them
normally in the beginning. However, after an unknown event happens
(I’m still trying to discover which event it is), the server
continues accepting requests, but it stops responding to them.

I’ve already checked the Process Monitor (the server is running on
Windows Server 2012 R2) and I could notice that when this problem
happens, new requests generate a TCP Accept, a TCP Receive, but
not a TCP Send nor a Disconnect.

I tried to execute the server in debug mode, but then again, when
this problem happens the debugger does not work and it hangs up as
well.

The server doesn’t explode and no errors occur. Thus, domains
won’t help me in this case. I’ve tried to handle
uncaughtException, but it also didn’t work.

The server keeps running without using excessive processor or
memory resources. Its behavior is still similar to the one during
the first execution, except for the fact that it’s not responding
as it was before.

When I sent a SIGNAL via console, the server simply started
working normally again without restarting or anything. It just got
back to normal.

I tried to execute a lot of requests using ApacheBench and
NeoLoad, but I just can’t reproduce this problem. It simply
happens randomly.

The socket has a timeout of two minutes. However, the server keeps
hanging up the requests for hours.

When I sent the SIGNAL mentioned before, all requests that were
hanging were executed, as if they were in a queue waiting for the
last request to be finished.

I don’t know what else could I do to find out what is causing this
problem.


I'm using Node.js + Express + body-parser + cookie-parser +
Windows Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.


*If somebody has any idea of what is causing the server to hang up
forever, please tell me.*


Best Regards,

*Moacir Braga*

--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

---
You received this message because you are subscribed to the Google 
Groups nodejs group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to nodejs+unsubscr...@googlegroups.com 
mailto:nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com 
mailto:nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/afac9a62-d246-4a27-b2fc-bd800165d986%40googlegroups.com 
https://groups.google.com/d/msgid/nodejs/afac9a62-d246-4a27-b2fc-bd800165d986%40googlegroups.com?utm_medium=emailutm_source=footer.

For more options, visit https://groups.google.com/d/optout.


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups nodejs group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/55CBED66.8080808%40bonseletrons.com.br.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-12 Thread alainm
Hi, I am using Mandrill in one other application. I had some problems until 
I started checking for errors and implemented 10 retries as 30s interval.

After that I never had problems again...




Enviado através do AquaMail para Android
http://www.aqua-mail.com


A 12 de agosto de 2015 16:39:30 Moacir Braga cont...@moacirbrg.org escreveu:


Sorry for my late, but I was monitoring the server after I restarted it
last friday, but so far no problem happened again.

Zlatko:
  - I checked the http.globalAgent.maxSockets and it is setted to Infinity
(default in Node 0.12.7).
  - I'm using a third-party service (Mandrill), by the way, maybe it is the
problem, I don't know, I'll remove it and put a simple SMTP library instead.
  - No, I didn't count how many requests because it's really random,
sometimes hangs up after few hours, sometimes after few days, but your
suggestion is really good for many purposes and I'll implement it.

Boby:
  - Really good question, I'm using Tcpview to figure out, but nothing is
open when the problem happens.
  - The server has a timeout of two minutes, in other words, if some socket
still opened for a while, the main program will wait only for two minutes
and will terminate the hanged connection.

When I restarted the server last friday, this problem doesn't happen
anymore, maybe something in Windows was hanging node process, I don't know.

One change I made was remove setInterval from my code, this timer was used
to remove invalid sessions. After some tests I figured out that setInterval
hangs up the console, but I can't believe in a direct relation between
setInterval and a hanged response. I don't know if this change together a
server restart was what helped me...

So, I'll be monitoring the server and if the problem happens again, I'll
notify you to confirm that isn't the timer.

On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:

 It’s been a few weeks since I started trying to solve this problem, but I
 still haven’t figured out a possible solution. The issue is that my server
 accepts requests and responds to them normally in the beginning. However,
 after an unknown event happens (I’m still trying to discover which event it
 is), the server continues accepting requests, but it stops responding to
 them.



 I’ve already checked the Process Monitor (the server is running on Windows
 Server 2012 R2) and I could notice that when this problem happens, new
 requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a
 Disconnect.



 I tried to execute the server in debug mode, but then again, when this
 problem happens the debugger does not work and it hangs up as well.



 The server doesn’t explode and no errors occur. Thus, domains won’t help
 me in this case. I’ve tried to handle uncaughtException, but it also didn’t
 work.



 The server keeps running without using excessive processor or memory
 resources. Its behavior is still similar to the one during the first
 execution, except for the fact that it’s not responding as it was before.



 When I sent a SIGNAL via console, the server simply started working
 normally again without restarting or anything. It just got back to normal.



 I tried to execute a lot of requests using ApacheBench and NeoLoad, but I
 just can’t reproduce this problem. It simply happens randomly.



 The socket has a timeout of two minutes. However, the server keeps hanging
 up the requests for hours.



 When I sent the SIGNAL mentioned before, all requests that were hanging
 were executed, as if they were in a queue waiting for the last request to
 be finished.



 I don’t know what else could I do to find out what is causing this problem.


 I'm using Node.js + Express + body-parser + cookie-parser + Windows
 Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.


 *If somebody has any idea of what is causing the server to hang up
 forever, please tell me.*


 Best Regards,

 *Moacir Braga*


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

---
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to nodejs+unsubscr...@googlegroups.com.

To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/3a4ac85f-4ae6-46cb-8806-c5081fccc1df%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups nodejs group.

To unsubscribe from this group and stop 

Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-09 Thread boby rahmawan
Hi moacir, is there any socket process not completed to execute? Maybe it
can make your server not responding because main program wait the response
from socket.
On Aug 9, 2015 10:55 PM, zladuric zladu...@gmail.com wrote:

 Well, in that case, I would say it looks like a memory leak or something.
 You say the socket should close in two minutes - are you leaving some
 closures there too? Maybe those get piled up and then afterwards they only
 accept new requests when old ones expire.

 Did you count how many requests get piled up before this block?

 Also, you seem to also be using third-party services - outgoing calls?
 Your global max of http connections is set?

 Zlatko


 On Sunday, August 9, 2015 at 3:21:23 AM UTC+2, Moacir Braga wrote:

 Hello Rob. I'm not using webpack nor sass.

 Zladuric, I'm logging the connections and I found one service that
 usually is involved with the problem, however when I restart the
 application, I create a request with the same logged data, but the problem
 does not reproduce. Strange, right? Not be able to reproduce an error is
 really bad.

 I analysed the function, but all outputs are handled with HTTP 200 or
 302, i.e., I'm always closing the connections, but even if I don't, the
 socket should do that in two minutes.

 Sometimes I think about if this problem happens only on Windows... but
 unfortunately I must use Windows because this application is just a
 middleware for my main solution.

 On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:

 It’s been a few weeks since I started trying to solve this problem, but
 I still haven’t figured out a possible solution. The issue is that my
 server accepts requests and responds to them normally in the beginning.
 However, after an unknown event happens (I’m still trying to discover which
 event it is), the server continues accepting requests, but it stops
 responding to them.



 I’ve already checked the Process Monitor (the server is running on
 Windows Server 2012 R2) and I could notice that when this problem happens,
 new requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a
 Disconnect.



 I tried to execute the server in debug mode, but then again, when this
 problem happens the debugger does not work and it hangs up as well.



 The server doesn’t explode and no errors occur. Thus, domains won’t help
 me in this case. I’ve tried to handle uncaughtException, but it also didn’t
 work.



 The server keeps running without using excessive processor or memory
 resources. Its behavior is still similar to the one during the first
 execution, except for the fact that it’s not responding as it was before.



 When I sent a SIGNAL via console, the server simply started working
 normally again without restarting or anything. It just got back to normal.



 I tried to execute a lot of requests using ApacheBench and NeoLoad, but
 I just can’t reproduce this problem. It simply happens randomly.



 The socket has a timeout of two minutes. However, the server keeps
 hanging up the requests for hours.



 When I sent the SIGNAL mentioned before, all requests that were hanging
 were executed, as if they were in a queue waiting for the last request to
 be finished.



 I don’t know what else could I do to find out what is causing this
 problem.


 I'm using Node.js + Express + body-parser + cookie-parser + Windows
 Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.


 *If somebody has any idea of what is causing the server to hang up
 forever, please tell me.*


 Best Regards,

 *Moacir Braga*

 --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/75a9f95f-f069-4449-b8d8-4bf2a8d20a01%40googlegroups.com
 https://groups.google.com/d/msgid/nodejs/75a9f95f-f069-4449-b8d8-4bf2a8d20a01%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit