Hello all!

   Recently I came across a problem that CPU 100% when nginx upstream were trying to SSL handshake to the web sever.

   the pass_proxy url is https://www.salesforce.com/export/login-messages/common/css/images/login/bk_promo_overlay3.png;

   maybe the slow https web site has the same problem.

 

The debug log:

2013/01/30 11:06:23 [debug] 19604#0: posted event 100232FC

2013/01/30 11:06:23 [debug] 19604#0: *1 delete posted event 100232FC

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL handshake handler: 1

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL_do_handshake: -1

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL_get_error: 2

2013/01/30 11:06:23 [debug] 19604#0: posted event 00000000

2013/01/30 11:06:23 [debug] 19604#0: worker cycle

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:6 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:3 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:7 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:7 wr:1

2013/01/30 11:06:23 [debug] 19604#0: max_fd: 7

2013/01/30 11:06:23 [debug] 19604#0: select timer: 46801

2013/01/30 11:06:23 [debug] 19604#0: select ready 1

2013/01/30 11:06:23 [debug] 19604#0: select write 7

2013/01/30 11:06:23 [debug] 19604#0: *1 post event 100232FC

2013/01/30 11:06:23 [debug] 19604#0: timer delta: 0

2013/01/30 11:06:23 [debug] 19604#0: posted events 100232FC

2013/01/30 11:06:23 [debug] 19604#0: posted event 100232FC

2013/01/30 11:06:23 [debug] 19604#0: *1 delete posted event 100232FC

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL handshake handler: 1

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL_do_handshake: -1

2013/01/30 11:06:23 [debug] 19604#0: *1 SSL_get_error: 2

2013/01/30 11:06:23 [debug] 19604#0: posted event 00000000

2013/01/30 11:06:23 [debug] 19604#0: worker cycle

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:6 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:3 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:7 wr:0

2013/01/30 11:06:23 [debug] 19604#0: select event: fd:7 wr:1

2013/01/30 11:06:23 [debug] 19604#0: max_fd: 7

 

we can see the write handler will repeat again and again until the SSL_do_handshake return 1.

i just repear the problem in select I/O multiplexing.

Can you help me to fix this bug?

 

Thanks