Comment 6 for bug 583031

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 583031] Re: Connect in a blocking mode hangs

Hi!

So looking at this I have created a test case. While the patch does modify the error returned, I am not finding that it adjusts the timeout (aka, I am still get a constant timeout).

Let me tinker with this.

The logic is supposed to be that a connection which errors out immediately returns error, but that we allow the connection to proceed while we move on (aka, we check it when needed).

Cheers,
 -Brian

On Jun 7, 2010, at 12:19 PM, Egor Egorov wrote:

> Steve,
>
> I would also suggest you to log failed connection attempts in the logs.
> We experience about 20-30 failures/day within a single EC2 availability
> zone with no downtime of nodes! While this itself is a relatively small
> number, it is still not okay. See if you will have a different
> experience with that.
>
> Please let me know. Thanks!
>
> --
> Connect in a blocking mode hangs
> https://bugs.launchpad.net/bugs/583031
> You received this bug notification because you are a member of
> Libmemcached-developers, which is the registrant for libmemcached.
>
> Status in libmemcached - A C and C++ client library for memcached: New
>
> Bug description:
> If the connect is performed in a blocking mode, then there is no timeout on connection. Therefor, trying to connect to a non-reachable host will timeout in a few minutes instead of values specified.
>
> If I remove the around connect.c:333 then connection works well:
>
> if (ptr->root->flags.no_block == false)
> timeout= -1;
>
> How to reproduce:
> 1. pick an unreachable IP, like, 10.2.3.4 routed via 127.0.0.1.
> 2. Use the following simple (php, unfortunately) code:
>
>
> $_memcache = new Memcached();
> $_memcache->addServer("10.2.3.4", "11211");
>
> $_memcache->setOption(Memcached::OPT_CONNECT_TIMEOUT, 1000);
> $_memcache->setOption(Memcached::OPT_RETRY_TIMEOUT, 1000);
> $_memcache->setOption(Memcached::OPT_SEND_TIMEOUT, 10000);
> $_memcache->setOption(Memcached::OPT_RECV_TIMEOUT, 10000);
> $_memcache->setOption(Memcached::OPT_POLL_TIMEOUT, 1000);
> $_memcache->setOption(Memcached::OPT_SERVER_FAILURE_LIMIT, 3);
>
> printf("here1\n");
> $result = $_memcache->get("dsf");
> printf("here2\n");
>
>
> Expected result: timeout.
>
> Actual result: timeout in something like ~6 minutes.
>
> Actual result with the mentioned line removed: timeout.
>
> Was tested on libmemcached 0.40, memcached php extension 1.0.2 on php 5.3.2 on Mac OS X 10.6.3.
>
>