In incrWithInit(), when the WRITE_BACKGROUND flag is set, return
true on success, don't try to return the new value. Use the noreply
option to avoid waiting for a response.
assertEquals(3, true) unexpectedly succeeds, so use assertSame() in the
relevant tests. Fix the type of the incr() return value in
MemcachedClient, was string.
Bug: T310662
Change-Id: I1a41255c304b1ac2b6086e7820390c3cbad2e789
merge() on a non-existent key always fails because in all commands, the
client flags an empty result list as an error, causing mergeViaCas() to
abort with a log warning. This showed up as a test failure in
BagOStuffTestBase::testMerge(). It's unclear how that test could have
ever worked.
So, make it not do that. Follow MemcachedPeclBagOStuff in making "not
found" return false without being an error.
Change-Id: I0f70ce8acea00576d4bf79068d039f28111286f7
* Enforce the ban on is_resource in phpcs
* In OrderedStreamingForkController, the comment was incorrect. I
confirmed using a small test script that if the child closes one end
of a socket pair, the other end will still be open, and is_resource()
will still return true, and fclose() will not fail. The issue was
introduced in c82d30d19c, it was not present in the
CirrusSearch copy of the class.
* Allow is_resource() for debug logging.
* Allow is_resource() for parameter validation where a stream may be
passed to a function, since there is no alternative.
Bug: T260735
Change-Id: I59a752f7bb4b043ddfb2434b52a02f9221bf54db
Use ERR_UNREACHABLE and ERR_NO_RESPONSE in various error cases,
rather than just using ERR_UNEXPECTED.
Bug: T252951
Change-Id: I5c15362132b8c80aad973520e0addc474bb38c22
Deconstructing non-sparse, numerically indexed arrays directly in
foreach (a.k.a. using the list() syntax in foreach) is possible since
PHP 5.5.
The possibility to use string array keys as well as non-sequential
numeric keys in array deconstruction was added in PHP 7.1.
Change-Id: I56a48552a45f61cedc291b306cad8548fc70d485
This saves a few bytes in the response size and make it easy
for memcached proxies to distinguish key fetches that are part
of check-and-set cycles from those that are not.
MediumSpecificBagOStuff now requires PASS_BY_REF to fetch CAS
tokens. BagOStuff::merge() and WinCacheBagOStuff::doCas() are
the only callers that need this mode.
Bug: T257003
Change-Id: If91963f58adc4cda94f6d634ee0252a479a0fc5e