You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by gr...@apache.org on 2013/01/18 01:06:34 UTC
svn commit: r1434976 - /apr/apr/trunk/poll/unix/z_asio.c
Author: gregames
Date: Fri Jan 18 00:06:20 2013
New Revision: 1434976
URL: http://svn.apache.org/viewvc?rev=1434976&view=rev
Log:
apr_pollset_remove: use a separate aiocb pointing to the original for cancelling async i/o. this fixes a leak
in USS for every keepalive timeout combined with CPU growth on the httpd listener thread
Modified:
apr/apr/trunk/poll/unix/z_asio.c
Modified: apr/apr/trunk/poll/unix/z_asio.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/z_asio.c?rev=1434976&r1=1434975&r2=1434976&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/z_asio.c (original)
+++ apr/apr/trunk/poll/unix/z_asio.c Fri Jan 18 00:06:20 2013
@@ -475,6 +475,7 @@ static apr_status_t asio_pollset_remove(
asio_elem_t *elem;
apr_status_t rv = APR_SUCCESS;
apr_pollset_private_t *priv = pollset->p;
+ struct aiocb cancel_a; /* AIO_CANCEL is synchronous, so autodata works fine */
int fd;
@@ -503,7 +504,8 @@ static apr_status_t asio_pollset_remove(
if (elem->state == ASIO_INIT) {
/* asyncio call to cancel */
- elem->a.aio_cmd = AIO_CANCEL;
+ cancel_a.aio_cmd = AIO_CANCEL;
+ cancel_a.aio_buf = &elem->a;
/* we want the original aiocb to show up on the pollset message queue
* to eliminate race conditions