GoogleCloudPlatform / GoogleCloudPlatform/appengine-php-sdk
Memcache: Set result code on successful getMulti/peekMulti
- Dominant language
- PHP
- Stars
- 29
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
`getMultiInternal()` only assigns `result_code` in its error path, so a successful multi-get reports whatever result code was left behind by the previous operation. In particular, a failed `add()` (`RES_NOTSTORED` — a routine occurrence when `add()` is used as a lock primitive) makes every subsequent `getMulti()`/`peekMulti()` look like a failure to callers that check `getResultCode()` to validate the operation, even though the call returned valid data.
Every other operation (`get`, `set`, `add`, `deleteMulti`, `increment`, `flush`) already updates the result code on success; this brings `getMultiInternal()` in line by setting `RES_SUCCESS` once the Get RPC completes.
Contributor guide
Research direction
Start at the getMultiInternal() entry point and compare its success handling with the error path and the other operations named in the issue. Confirm that the Get RPC completes before the successful result code is assigned. Done means successful getMulti() and peekMulti() calls report RES_SUCCESS even after a failed add().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100