| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A stat with a blank value makes the .stats() call fail with index error.
```
memcache_connection.stats()
File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 741, in stats
result = self._fetch_cmd(b'stats', args, False)
File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 921, in _fetch_cmd
result[key_value[1]] = key_value[2]
IndexError: list index out of range
```
The line in question we saw that caused this:
```
b'STAT ep_initfile '
```
This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug.
Co-authored-by: reecepeg <reecepeg@amazon.com>
|
| |
|
|
|
|
|
|
|
| |
The regular client supports noreply so pass args, kwargs like for other
functions in hash client
Fixes issue #360
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using HashClient with ignore_exc, get would always return
None if no server is available and the default is passed as a
positional argument. The other clients return the default
value in this case. An earlier fix only had the desired effect when
passing default as a keyword argument.
For example, Django passes the default as a positional argument.
Return the default value so HashClient behaves like the other
clients.
|
| |
|
|
|
|
|
|
|
| |
ignore_exc should treat an error as a cache miss and default specifies
what should be returned on a miss.
Fixes issue #350
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Implement RetryingClient
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
These changes allow us to rely on tox when we execute our linters on CI.
They centralize the way we define our jobs and targets to use them
in standardized way locally and during CI pipelines.
With these changes we are sure to execute the same commands everywhere.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
During network maintenance operations or during server reboot users could
face MemcacheUnexpectedCloseError.
This kind of exception will be raised down the stack. It's a design
choice [1]. Users should manage this kind of exception.
However, at some points the opened sockets remains more or less opened
after this kind of fail on the client side [2]. It will require n+1
calls to see them recreated when the connection will be possible. That's
could be problem with services that implement several cache logics in parallel
and where their clients are based on pymemcache.
These changes simply ensure to close the socket properly. The socket
will be recreated by the client if needed.
[1] https://github.com/pinterest/pymemcache/issues/307
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1977711
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
The _store_cmd method became a bit to complexe and the linter complains
when we add new conditions or try/except clause.
These changes outsource some some processsing to reduce the complexity
of the method.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
I think the value provided by codespell is low and not worth the CPU
cycles to run it on ever change.
Also, the flake8 complexity check isn't particularly helpful (in my
opinion).
|
| | |
|
| |
| |
| | |
Closes #330
|
|/
|
|
|
|
|
| |
9551dfd0 introduced a call to socket.getaddrinfo() to support IPv6, but
we never added an implementation of that function to MockSocketModule.
This resulted in some tests making "live" socket.getaddrinfo() calls
because of the default MockSocketModule.__getattr__ implementation
(which we need to forward other module attribute lookups).
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The Memcached server can be configured to drop idle connections (via the
idle_timeout option). When this occurs, pymemcache may still try to
use the connection, resulting in MemcacheUnexpectedCloseError. Hence
the need for client-side idle timeout logic.
|
|\
| |
| | |
Use client.set_many in HashClient.
|
|/ |
|
|\ |
|
|/ |
|
|\ |
|
|/
|
|
|
|
|
| |
Overlooked when UNIX socket support was added to `HashClient` in
acd962b586a4fe018a00acb7e1621be373c13c3b.
Fixes #314.
|
| |
|
|
|
| |
According to the Memcached Protocol, the no argument form of the stats command should have no trailing spaces. Currently, b'stats \r\n' instead of b'stats\r\n' is being sent to the socket which leads to a malformed response.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_check_cas() does a good job of normalizing a CAS value and raising
MemcacheIllegalInputError when fed an invalid value. We were only using
this function in the `cas is not None` path within _store_cmd().
By moving this check into cas() itself, it allows us to also raise
MemcacheIllegalInputError when `cas is None`, which can happen when this
pattern is used for a new key:
val, cas = c.gets('key')
c.cas('key', 'value', cas)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GitHub Actions appears to be busted with regard to IPv6-based localhost
resolution between containers. This prevents us from successfully
connecting to our memcached service containers.
We can't resolve this by using `--server` (and `--tls-server`) to
explicitly specify 127.0.0.1 to force IPv4, but that unfortunately
breaks TLS certification verification because that expects 'localhost'.
We should come up with a better solution for this, but for the short
term, this unblocks the failing CI builds.
|
|
|
|
|
| |
IPv6 may be used in preference to IPv4 when passing a domain name as the
host if an IPv6 address can be resolved for that domain.
|
|
|
|
|
| |
- https://pythoninsider.blogspot.com/2020/10/python-35-is-no-longer-supported.html
- https://pythoninsider.blogspot.com/2020/10/python-390-is-now-available-and-you-can.html
|
| |
|
| |
|
|\
| |
| | |
Removed print() in test.
|