SSI bug with mutil include?

hi nginx:
please give me some help or hint:
I encountered a problem while ssi delegaties back end memcached
servers.
(ssi dispatches each include to a location with memcache_pass , which
takes
use of upstream.)

ssi file looks like:



After request for the url point to the ssi file, there is half of the
chances I cant get any response. Request is blocked for 60 seconds(the
epoll
time-out) ends with nothing.
Sometimes I got the right response. the more include directives there
are,
the more chances requests are blocked.

But if I add ‘wait=“yes”’ attribute to each include, there will be no
problem.

I straced nginx, found that nginx closes the incorrect FD.

43 epoll_wait(8, {{EPOLLOUT, {u32=166951744,
u64=13826368082478857024}},
{EPOLLOUT, {u32=166951824, u64=13826368082478857104}}, {EPOLLOUT,
{u32=166951664, u64=13826368082478856944}}, {EPOLLOUT, {u32=166951584,
u64=13826368082478856864}}, {EPOLLOUT, {u32=166951504,
u64=13826368082478856784}}, {EPOLLOUT, {u32=166951424,
u64=13826368082478856704}}, {EPOLLOUT, {u32=166951344,
u64=13826368082478856624}}, {EPOLLOUT, {u32=166951264,
u64=13826368082478856544}}, {EPOLLOUT, {u32=166951184,
u64=13826368580695062800}}}, 512, 60000) = 9
44 gettimeofday({1217429875, 344754}, NULL) = 0
45 getsockopt(16, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
46 writev(16, [{“get db_8\r\n”, 10}], 1) = 10
47 getsockopt(15, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
48 writev(15, [{“get db_7\r\n”, 10}], 1) = 10
49 getsockopt(14, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
50 writev(14, [{“get db_6\r\n”, 10}], 1) = 10
51 getsockopt(13, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
52 writev(13, [{“get db_5\r\n”, 10}], 1) = 10
53 getsockopt(12, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
54 writev(12, [{“get db_4\r\n”, 10}], 1) = 10
55 getsockopt(11, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
56 writev(11, [{“get db_3\r\n”, 10}], 1) = 10
57 getsockopt(10, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
58 writev(10, [{“get db_2\r\n”, 10}], 1) = 10
59 getsockopt(9, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
60 writev(9, [{“get db_1\r\n”, 10}], 1) = 10
61 recv(6, 0xbfe125db, 1, MSG_PEEK) = -1 EAGAIN (Resource
temporarily unavailable)
62
63 epoll_wait(8, {{EPOLLIN|EPOLLOUT, {u32=166951344,
u64=13826368082478856624}}, {EPOLLIN|EPOLLOUT, {u32=166951424,
u64=13826368082478856704}}, {EPOLLIN|EPOLLOUT, {u32=166951504,
u64=13826368082478856784}}, {EPOLLIN|EPOLLOUT, {u32=166951584,
u64=13826368082478856864}}, {EPOLLIN|EPOLLOUT, {u32=166951664,
u64=13826368082478856944}}, {EPOLLIN|EPOLLOUT, {u32=166951824,
u64=13826368082478857104}}, {EPOLLIN|EPOLLOUT, {u32=166951744,
u64=13826368082478857024}}}, 512, 59997) = 7
64 gettimeofday({1217429875, 346743}, NULL) = 0
65 recv(10, “VALUE db_2 0 1\r\n2\r\nEND\r\n”, 100, 0) = 24
66 setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
67 close(9) = 0
68 recv(11, “VALUE db_3 0 1\r\n3\r\nEND\r\n”, 100, 0) = 24
69 writev(6, [{“HTTP/1.1 200 OK\r\nServer: nginx/0”…, 165}, {“5\r\n”,
3},
{“Var=[”, 5}, {"\r\n", 2}, {“1\r\n”, 3}, {",", 1}, {"\r\n", 2},
{“1\r\n”,
3}, {“2”, 1}, {"\r\n", 2}], 10) = 187
70 close(10) = 0
71 recv(12, “VALUE db_4 0 1\r\n4\r\nEND\r\n”, 100, 0) = 24
72 writev(6, [{“1\r\n”, 3}, {",", 1}, {"\r\n", 2}, {“1\r\n”, 3}, {“3”,
1},
{"\r\n", 2}], 6) = 12
73 close(11) = 0
74 recv(13, “VALUE db_5 0 1\r\n5\r\nEND\r\n”, 100, 0) = 24
75 writev(6, [{“1\r\n”, 3}, {",", 1}, {"\r\n", 2}, {“1\r\n”, 3}, {“4”,
1},
{"\r\n", 2}], 6) = 12
76 close(12) = 0
77 recv(14, “VALUE db_6 0 1\r\n6\r\nEND\r\n”, 100, 0) = 24
78 writev(6, [{“1\r\n”, 3}, {",", 1}, {"\r\n", 2}, {“1\r\n”, 3}, {“5”,
1},
{"\r\n", 2}], 6) = 12
79 close(13) = 0
80 recv(15, “VALUE db_7 0 1\r\n7\r\nEND\r\n”, 100, 0) = 24
81 writev(6, [{“1\r\n”, 3}, {",", 1}, {"\r\n", 2}, {“1\r\n”, 3}, {“6”,
1},
{"\r\n", 2}], 6) = 12
82 close(14) = 0
83 recv(16, “VALUE db_8 0 1\r\n8\r\nEND\r\n”, 100, 0) = 24
84 writev(6, [{“1\r\n”, 3}, {",", 1}, {"\r\n", 2}, {“1\r\n”, 3}, {“7”,
1},
{"\r\n", 2}], 6) = 12
85 close(15) = 0
86 epoll_wait(8,

Anybody might had experienced such problem can help me? I’ll be very
appreciated.

Is it a known bug?
I am trying to solve this problem, looking for something help through
source-codes.

I encountered a problem while ssi delegaties back end memcached servers.
Anybody might had experienced such problem can help me?

I can confirm that the same behavior happens to me. Unfortunately, I
have not
found a solution to the issue.

dr-dr xp <drdr.xp@…> writes:

hi nginx:Â please give me some help or hint:Â I encountered a problem while
ssi delegaties back end memcached servers. (ssi dispatches each include
to a
location with memcache_pass , which takes use of upstream.)
  ssi file looks like:         …After request for the url point to the ssi file, there is half of
the
chances I cant get any response. Request is blocked for 60 seconds(the
epoll
time-out)Â ends with nothing. Sometimes I got the right response. the
more
include directives there are, the more chances requests are blocked. But
if I
add ‘wait=“yes”’ attribute to each include, there will be no problem.I
straced
nginx, found that nginx closes the incorrect FD. 43 epoll_wait(8,
{{EPOLLOUT, {u32=166951744, u64=13826368082478857024}}, {EPOLLOUT,
{u32=166951824, u64=13826368082478857104}}, {EPOLLOUT, {u32=166951664,
u64=13826368082478856944}}, {EPOLLOUT, {u32=166951584,
u64=13826368082478856864}}, {EPOLLOUT, {u32=166951504,
u64=13826368082478856784}}, {EPOLLOUT, {u32=166951424,
u64=13826368082478856704}}, {EPOLLOUT, {u32=166951344,
u64=13826368082478856624}}, {EPOLLOUT, {u32=166951264,
u64=13826368082478856544}}, {EPOLLOUT, {u32=166951184,
u64=13826368580695062800}}}, 512, 60000) = 9Â 44 gettimeofday({1217429875,
344754}, NULL) = 0Â 45 getsockopt(16, SOL_SOCKET, SO_ERROR, [0], [4]) =
0Â 46
writev(16, [{“get db_8\r\n”, 10}], 1)Â Â = 10Â 47 getsockopt(15,
SOL_SOCKET,
SO_ERROR, [0], [4]) = 0Â 48 writev(15, [{“get db_7\r\n”, 10}], 1)Â Â =
10Â 49
getsockopt(14, SOL_SOCKET, SO_ERROR, [0], [4]) = 0Â 50 writev(14, [{“get
db_6\r\n”, 10}], 1)Â Â = 10Â 51 getsockopt(13, SOL_SOCKET, SO_ERROR, [0],
[4]) =
0Â 52 writev(13, [{“get db_5\r\n”, 10}], 1)Â Â = 10Â 53 getsockopt(12,
SOL_SOCKET,
SO_ERROR, [0], [4]) = 0Â 54 writev(12, [{“get db_4\r\n”, 10}], 1)Â Â =
10Â 55
getsockopt(11, SOL_SOCKET, SO_ERROR, [0], [4]) = 0Â 56 writev(11, [{“get
db_3\r\n”, 10}], 1)Â Â = 10Â 57 getsockopt(10, SOL_SOCKET, SO_ERROR, [0],
[4]) =
0Â 58 writev(10, [{“get db_2\r\n”, 10}], 1)Â Â = 10Â 59 getsockopt(9,
SOL_SOCKET,
SO_ERROR, [0], [4]) = 0Â 60 writev(9, [{“get db_1\r\n”, 10}], 1)Â Â Â Â =
10Â 61
recv(6, 0xbfe125db, 1, MSG_PEEK)Â Â Â Â Â Â Â Â = -1 EAGAIN (Resource
temporarily
unavailable)Â 62 Â 63 epoll_wait(8,
{{EPOLLIN|EPOLLOUT, {u32=166951344, u64=13826368082478856624}},
{EPOLLIN|EPOLLOUT, {u32=166951424, u64=13826368082478856704}},
{EPOLLIN|EPOLLOUT, {u32=166951504, u64=13826368082478856784}},
{EPOLLIN|EPOLLOUT, {u32=166951584, u64=13826368082478856864}},
{EPOLLIN|EPOLLOUT, {u32=166951664, u64=13826368082478856944}},
{EPOLLIN|EPOLLOUT, {u32=166951824, u64=13826368082478857104}},
{EPOLLIN|EPOLLOUT, {u32=166951744, u64=13826368082478857024}}}, 512,
59997) = 7Â 64 gettimeofday({1217429875, 346743}, NULL) = 0Â 65 recv(10, “VALUE
db_2 0 1\r\n2\r\nEND\r\n”, 100, 0) = 24Â 66 setsockopt(6, SOL_TCP,
TCP_NODELAY,
[1], 4) = 0Â 67 close(9)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 68 recv(11,
“VALUE
db_3 0 1\r\n3\r\nEND\r\n”, 100, 0) = 24Â 69 writev(6,
[{“HTTP/1.1 200 OK\r\nServer: nginx/0”…, 165}, {“5\r\n”, 3},
{“Var=[”, 5}, {"\r\n", 2}, {“1\r\n”, 3}, {",", 1}, {"\r\n", 2},
{“1\r\n”, 3}, {“2”, 1}, {"\r\n", 2}], 10) = 187Â 70
close(10)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 71 recv(12, “VALUE db_4 0
1\r\n4\r\nEND\r\n”, 100, 0) = 24Â 72 writev(6, [{“1\r\n”, 3}, {",", 1},
{"\r\n",
2}, {“1\r\n”, 3}, {“3”, 1}, {"\r\n", 2}], 6) = 12Â 73
close(11)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 74 recv(13, “VALUE db_5 0
1\r\n5\r\nEND\r\n”, 100, 0) = 24Â 75 writev(6, [{“1\r\n”, 3}, {",", 1},
{"\r\n",
2}, {“1\r\n”, 3}, {“4”, 1}, {"\r\n", 2}], 6) = 12Â 76
close(12)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 77 recv(14, “VALUE db_6 0
1\r\n6\r\nEND\r\n”, 100, 0) = 24Â 78 writev(6, [{“1\r\n”, 3}, {",", 1},
{"\r\n",
2}, {“1\r\n”, 3}, {“5”, 1}, {"\r\n", 2}], 6) = 12Â 79
close(13)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 80 recv(15, “VALUE db_7 0
1\r\n7\r\nEND\r\n”, 100, 0) = 24Â 81 writev(6, [{“1\r\n”, 3}, {",", 1},
{"\r\n",
2}, {“1\r\n”, 3}, {“6”, 1}, {"\r\n", 2}], 6) = 12Â 82
close(14)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 83 recv(16, “VALUE db_8 0
1\r\n8\r\nEND\r\n”, 100, 0) = 24Â 84 writev(6, [{“1\r\n”, 3}, {",", 1},
{"\r\n",
2}, {“1\r\n”, 3}, {“7”, 1}, {"\r\n", 2}], 6) = 12Â 85
close(15)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â = 0Â 86 epoll_wait(8, Anybody
might had
experienced such problem can help me? I’ll be very appreciated.Is it a
known
bug?I am trying to solve this problem, looking for something help
through
source-codes.-- è¦äº†å‡ å¤©é¥±é¥­å°±ä¸è®°å¾—è¥¿åŒ—é£Žå•¥å‘³äº†