When I use straceon Apache while it acts unresponsive, I get the following output:

[pid 13704] fcntl(57, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = -1 EAGAIN (Resource temporarily unavailable)

What does it mean and what kind of lock would the process need to be responsive again?

  • Can you strace -y or otherwise resolve what fd 57 points to? That might provide clues. – thrig May 12 '17 at 14:19

fcntl(57, F_SETLK, …) means that the process is trying to take a lock on the file which is open on file descriptor 57. The error EGAIN means that taking the lock failed because it's already taken by another process. The lock is specifically on the portion of the file from offset 1073741824 to offset 1073741825.

On Linux, you can use lslocks to see what locks are being held. To find who has the lock that Apache is waiting for, you'll need to know what file it's on; lsof -p $pid will tell you what file is open on fd 57.

Assuming that the process needs the lock to continue, it will not be responsive until whichever other process that has the lock releases it. The problem is not that a resource is not available and needs to be created, but that an existing resource is currently busy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.