Hi to everybody, long time ago this post was published but it works!!!
Using Freebsd 7.3 apache 2.2 php 5.4.7 php-fpm mod_fastcgi 2.4.6 and got
select() failed every time my long script started.
To apply it:
1. Make deinstall to module without clean.
2. Edit source file Tobias says in port www/mod_fastcgi/...
3. Run command to rebuild module noted in INSTALL ( apxs -o mod_fastcgi.so -c
*.c ).
4. Make install.
5. Restart apache.
Dont know who is author of module, but this change should be commited in the
core of module.
Many thanks to athor of patch.
Many thanks to mod_fastcgi athor.
Many thanks to apache and google community.
See you.
Неділя, 2 листопада 2008 р. 20:40:08 UTC+2 користувач Tobias Diedrich написав:
> Tobias Diedrich wrote:
> > However I think sleeping 1s before retrying is unnecessary (and having a
> > maximum amount of retries might be a bit paranoid), so I'm not saying this
> > patch should be applied as-is.
>
> I'm using the following modified patch now:
>
> Index: libapache-mod-fastcgi-2.4.2/mod_fastcgi.c
> ===================================================================
> --- libapache-mod-fastcgi-2.4.2.orig/mod_fastcgi.c 2008-11-02
> 16:42:49.000000000 +0000
> +++ libapache-mod-fastcgi-2.4.2/mod_fastcgi.c 2008-11-02 16:50:46.000000000
> +0000
> @@ -2178,12 +2178,15 @@
> }
>
> /* wait on the socket */
> - select_status = ap_select(nfds, &read_set, &write_set, NULL,
> &timeout);
> + /* Interrupted system calls do happen now and then, so retry on
> EINTR */
> + do {
> + select_status = ap_select(nfds, &read_set, &write_set, NULL,
> &timeout);
> + } while (select_status < 0 && errno == EINTR);
>
> if (select_status < 0)
> {
> ap_log_rerror(FCGI_LOG_ERR_ERRNO, r, "FastCGI: comm with server "
> - "\"%s\" aborted: select() failed", fr->fs_path);
> + "\"%s\" aborted: select() failed: \"%s\"", fr->fs_path,
> strerror(errno));
> state = STATE_ERROR;
> break;
> }
> @@ -2246,11 +2249,19 @@
> }
>
> rv = fcgi_buf_socket_recv(fr->serverInputBuffer, fr->fd);
> + /*
> + * select(2) states: Under Linux, select() may report a socket
> + * file descriptor as "ready for reading", while nevertheless a
> + * subsequent read blocks.
> + * Act as if the FD was not set if socket_recv returns EAGAIN.
> + */
> + if (rv < 0 && errno == EAGAIN)
> + break;
>
> if (rv < 0)
> {
> ap_log_rerror(FCGI_LOG_ERR, r, "FastCGI: comm with server "
> - "\"%s\" aborted: read failed", fr->fs_path);
> + "\"%s\" aborted: read failed: \"%s\"", fr->fs_path,
> strerror(errno));
> state = STATE_ERROR;
> break;
> }
>
> --
> Tobias PGP:
> http://9ac7e0bc.uguu.de
> このメールは十割再利用されたビットで作られています。
>
>
>
> --
> To UNSUBSCRIBE, email to [email protected]
> with a subject of "unsubscribe". Trouble? Contact [email protected]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]