Libunit: fixed shared memory waiting.
The nxt_unit_ctx_port_recv() function may return the NXT_UNIT_AGAIN code, in which case an attempt to reread the message should be made. The issue was reproduced in load testing with response sizes 16k and up. In the rare case of a NXT_UNIT_AGAIN result, a buffer of size -1 was processed, which triggered a 'message too small' alert; after that, the app process was terminated.
This commit is contained in:
@@ -48,6 +48,13 @@ appeared in 1.19.0.
|
|||||||
</para>
|
</para>
|
||||||
</change>
|
</change>
|
||||||
|
|
||||||
|
<change type="bugfix">
|
||||||
|
<para>
|
||||||
|
application processes could terminate unexpectedly under high load; the bug
|
||||||
|
had appeared in 1.19.0.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
</changes>
|
</changes>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3606,7 +3606,10 @@ nxt_unit_wait_shm_ack(nxt_unit_ctx_t *ctx)
|
|||||||
return NXT_UNIT_ERROR;
|
return NXT_UNIT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf);
|
do {
|
||||||
|
res = nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf);
|
||||||
|
} while (res == NXT_UNIT_AGAIN);
|
||||||
|
|
||||||
if (res == NXT_UNIT_ERROR) {
|
if (res == NXT_UNIT_ERROR) {
|
||||||
nxt_unit_read_buf_release(ctx, rbuf);
|
nxt_unit_read_buf_release(ctx, rbuf);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user