php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58500 memcache::set still causes resource unavaiable errors
Submitted: 2009-01-10 16:21 UTC Modified: 2010-04-08 06:04 UTC
From: p dot chapman dot uk+pecl at gmail dot com Assigned:
Status: Not a bug Package: memcache (PECL)
PHP Version: 5.2.5 OS: Linux / RedHat
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
11 + 8 = ?
Subscribe to this entry?

 
 [2009-01-10 16:21 UTC] p dot chapman dot uk+pecl at gmail dot com
Description:
------------
This is an extension of PECL bug #14044, which was supposedly fixed in memcache 3.0.2
I am also using the latest memcached 1.3.0

Intermittent bug when setting cache without compression. Memcache::set fails and produces a PHP notice..

"send of 32768 bytes failed with errno=11 Resource temporarily unavailable"

PECL Bug 14044 implies this only ever happens for 32768, however, I get this error for shorter length data too, (including 32678). 

Reproduce code:
---------------
Sorry, I cannot reliably reproduce this. But in a typical day, it occurs around 40 times in my php error log

Attempts to reproduce on dev server arent successful, and so I suspect it might be due to the live server being quite busy

Expected result:
----------------
Set operation to succeed without error

Actual result:
--------------
Memcache::set fails, with a notice emitted in PHP error log

send of XXXXX bytes failed with errno=11 Resource temporarily unavailable

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-16 07:57 UTC] mikael at synd dot info
The error originates from php_sockop_write() which regardless or the REPORT_ERRORS flag outputs a notice, this function is called from php_stream_write()

This is very odd since the 3.0.x versions of the extension doesn't use php_stream_write() or any other stream write functions at all but rather use send() directly. Also, the error message shouldn't say Memcache::set() but rather MemcachePool::set() even if you're instantiating the Memcache class (since it inherits from MemcachePool).

 * Are you sure it's originating from the pecl/memcache 3.0.2 extension and not a previous version (such as 2.2.x) or some other extension? 
 * Can you supply the complete log message?
 * It would really help if there was some kind of way to reproduce the message (or a gdb backtrace of the call stack when the error is emitted :)
 [2009-01-16 09:12 UTC] p dot chapman dot uk+pecl at gmail dot com
Hi, thanks for responding.

I thought I was using 3.0.2, but phpinfo() suggests it was still using 3.0.1. I cant explain that, but its probably a mistake I made, or maybe lighttpd didn't restart properly when I asked it to.

My setup is definitely using 3.0.2 now, so I will monitor the situation and see if it happens again. Ill look into getting a backtrace too.

Your right about the log saying MemcachePool rather than Memcache. Heres a few of the actual log entries, although I doubt it matters unless it happens again on 3.0.2. 

[10-Jan-2009 16:21:45] PHP Notice:  MemcachePool::set() [<a href='memcachepool.set'>memcachepool.set</a>]: send of 7861 bytes failed with errno=11 Resource temporarily unavailable in /var/dmn/html/class_cache.php on line 60
[10-Jan-2009 20:26:10] PHP Notice:  MemcachePool::set() [<a href='memcachepool.set'>memcachepool.set</a>]: send of 15904 bytes failed with errno=11 Resource temporarily unavailable in /var/dmn/html/class_cache.php on line 60
[11-Jan-2009 03:31:21] PHP Notice:  MemcachePool::set() [<a href='memcachepool.set'>memcachepool.set</a>]: send of 32768 bytes failed with errno=11 Resource temporarily unavailable in /var/dmn/html/class_cache.php on line 60

Thanks
 [2009-01-16 10:40 UTC] mikael at synd dot info
Please reopen the bug report if the problem is shown to still exist
 [2010-04-08 04:18 UTC] alitrix at gmail dot com
Does anyone know if this bug is still open?

If not, what is the fix.
phpinfo() tells me this about my memcache php library:
Version: 3.0.1
Revision: $Revision: 1.83.2.24 $

My memcache server versions are: 1.2.2
 [2010-04-08 06:04 UTC] p dot chapman dot uk+pecl at gmail dot com
I had further problems, but Im not sure it was a memcache bug

Try tweaking your sysctl.conf as shown here
http://cocacoda.blogspot.com/2009/02/memcached-fails-to-set-cache-entry.html

You might also look into making sure local memcache connections are not tracked by conntrack (by setting a raw NOTRACK iptables rule). I continued to have various problems until I did this, and now my setup is stable again.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 10:01:28 2024 UTC