Jump to content

Apache blocks when blocked in read_socket()-call


ml01172

Recommended Posts

I might be wrong, but this is what it looks like:

- I connect to the apache over a web-browser, and request a PHP script

- The PHP script then connects over TCP to a daemon on the system, requesting data

- The daemon does not answer with data immediately but the script has to wait instead

- The script waits and waits, and I turn off the web-browser, thus (as I understand) killing the php-instance on the server

- (The daemon is such that it doesn't close the runaway-sockets, i.e. when a client leaves it doesn't notice it and it doesn't close the corresponding sockets, so that might be an issue, but still.... keep reading)

- I request another page from the Apache

- It blocks forever.

- I kill the daemon

- The Apache immediately returns the page for the new request.

 

How do you explain this behaviour?

 

Thank you

Link to comment
Share on other sites

OK, nobody answered on this topic, but nobody could have - I made a wrong conclusion, and the question couldn't be answered.

If anybody interested, however, this is the deal: the script waited for the daemon to answer over the socket, thus blocking in the call. BUT, what happened earlier is that I opened the session by session_start() which locked the session file. Now, another instance of the same script for the same user required this same session file to be opened, thus waiting for it to be unlocked. This never happened, however, until the daemon answered and the first instance of the script finished, automatically unlocking the session file.

 

So, this kinda wasn't the question for Apache section, but rather for another, but I couldn't know that until I solved it.

 

Thank you, anyway, I see there were 57 views :) on the topic.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.