This changes the abort to an assert and tests for such failures.
try_read_command's return value of 0 indicates to the caller that more data is needed, thus it changes the connection state to conn_waiting which blows away the closing state and the connection stays open forever accumulating bad input.
critical fix: under multithreaded mode, in version 1.2.7, memcached would not resume accepting connections after hitting the max connections limit. this is due to a pre-existing bug in the accept_new_conns code, which was hit when the "fix" was rolled in to ensure listening threads never did real work. Previously, at least one closing connection would (randomly) be on the accepting thread, so the test for (are we the listening thread?) would still work.
(dustin) I made some changes to the original growth code to pass in the required size.
since 1.2.6, most of the refcount leaks have been quashed. I still get them in production, extremely rarely. It's possibly we'll have refcount leaks on and off even in the future. This hack acknowledges this and exists since we want to guarantee, as much as possible, that memcached is a stable service. Having to monitor for and restart the service on account of "rare bugs" isn't acceptable.
AF_UNSPEC is still necessary for UDP sometimes. We guarantee that at least one address returned from getaddrinfo binds successfully, and in cases of lacking network or ipv6 addresses some of those socket() calls might fail. That's normal. We were bailing on them. This change also removes the need to pass AI_ADDRCONFIG on machines with ipv6 stacks disabled.
This will allow more specific version numbers, while simplifying a proper release down to a tag and make dist. During development, ./version.sh needs to run periodically to update the version number. I'd recommend just adding a call to version.sh as a git post commit hook: % cat .git/hooks/post-commit echo "Updating version." ./version.sh (and make sure the file is executable)