| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The stat key `log_watchers` indicates the number of active connected
`watch` clients.
|
| |
|
|
|
|
|
|
|
| |
`-o ssl_min_version` can be used to configure the server to only accept
handshakes from clients with a minimum TLS protocol version. Currently
supported options are TLS v1.0, TLS v1.1, TLS v1.2, and TLS v1.3
(OpenSSL 1.1.1+ only).
|
|
|
|
|
|
|
|
|
|
| |
The previous commit (IO queue submit if queue is not NULL, instead of queue
count) exposed an apparent long standing bug in extstore: do an
ascii-multiget request with multiple keys, but one too-long or otherwise
garbage key. This will reset the queue count to 0 but leave a stack
pointer to now freed memory.
The next request could infinite loop, as this test was causing.
|
|
|
|
|
| |
instead of queue counter. only use the queue counter for figuring out
when to return the connection
|
|
|
|
|
|
|
|
|
|
|
| |
probably squash into previous commit.
io->c->thead can change for orpahned IO's, so we had to directly add the
original worker thread as a reference.
also tried again to split callbacks onto the thread and off of the
connection for similar reasons; sometimes we just need the callbacks,
sometimes we need both.
|
|
|
|
|
|
|
|
|
|
|
| |
instead of passing ownership of (io_queue_t)*q to the side thread,
instead the ownership of IO objects are passed to the side thread, which
are then individually returned. The worker thread runs return_cb() on
each, determining when it's done with the response batch.
this interface could use more explicit functions to make it more clear.
Ownership of *q isn't actually "passed" anywhere, it's just used or not
used depending on which return function the owner wants.
|
|
|
|
|
|
| |
now that all of the read/writes to the notify pipe are in one place,
we can easily use linux eventfd if available. This also allows batching
events so we're not firing the same notifier constantly.
|
|
|
|
|
|
|
| |
worker notification was a mix of reading data from pipe or examining a
an object queue stack. now it's all one interface. this is necessary to
switch signalling to eventfd or similar, since we won't have that pipe
to work with.
|
|
|
|
|
|
|
| |
help scalability a bit by having a per-worker-thread freelist and queue
for connection event items (new conns, etc). Also removes a hand-rolled
linked list and uses cache.c for freelist handling to cull some
redundancy.
|
|
|
|
|
|
|
|
|
| |
cache constructors/destructors were never used, which just ended up
being wasted branches. Since there's no constructor/destructor for cache
objects, we can use the memory itself for the freelist.
This removes a doubling realloc for the freelist of cache objects and
simplifies the code a bunch.
|
|
|
|
|
| |
FreeBSD version as there seems to be portability issues if you just use
sys/queue, plus some extra features I like in this one.
|
|
|
|
|
|
|
|
|
|
| |
Adding a new type of log entry required updating code in a bunch of
places. Now we use callbacks in the entry structure instead, cutting
down the code and some awkwardness. Should also make it easier for
plugins/extra systems to add log entries.
Moving the writer/parsers to their own section makes the actual logging
code easier to follow, as an added bonus.
|
|
|
|
|
|
|
|
|
| |
Inspired by #768 - logger thread would wake up once per second looking
for watchers or log entries, but without any watchers. Now sleeps on a
condition.
Note that if I ever actually get logger to syslog/stdout/stderr/etc
working properly this will still always poll.
|
|
|
|
|
|
|
|
| |
Add support for `watch connevents` to report opened (`conn_new`)
and closed (`conn_close`) client connections. Event log lines indicate
the connection's remote IP, remote port, and transport type.
`conn_close` events additionally supply a reason for the closing the
connection.
|
|
|
|
|
|
| |
This adds a new field `size` to logger entry lines for item_get,
item_store, and eviction events indicating the size of the associated
item in bytes.
|
|
|
|
|
| |
Note: Do not fix typos in crc32.c because it's copied from an upstream
source
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #805
Allocate an extra byte for reading the last entry when there is no `\n` at
the end of the file.
Also, check if the user contains null bytes when reading the last entry.
Unrelatedly, add handling in case the auth file size changes while it is being read.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using NDEBUG assert macro is ineffective which is caught by latest
clang and reports that total_written is set but unused. Therefore check
for NDEBUG to make sure assert is used only when its effective
Fixes
error: variable 'total_written' set but not used [-Werror,-Wunused-but-set-variable]
size_t size = 0, written = 0, total_written = 0;
^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
|
|
| |
my clang vim plugin whatevers creates a .cache directory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These changes aim to improve our memcached devtools images to allow us
to reuse them during development stages.
These changes create a memcached user for all the images, switch to this
user by default once memcached have been configured for building.
That allow to run the memcached server directly when the containers are
started, else, without the user the run will fail as we try to execute
memcached as root user.
Also we should notice that the alpine image has been fixed by adding git
to the list of the requirements to install. Else the build will fails.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had the response code as "HD" in the past, but standardized on OK
while merging a number of "OK-like" rescodes together. This was a
mistake; as many "generic" memcached response codes use "OK". Most of
these are management or specialized uncommon commands.
With this, a client response parser can know for sure if a response is
to a meta command, or some other command.
`-o meta_response_old` starttime option has been added, valid for the
next 3 months, which switches the response code back from HD to OK. In
case any existing users depended on this and need time to migrate.
|
|
|
|
|
|
|
| |
payload length is now part of the main command rather than a flag/token
pair. This allows byte swallow to be more reliable in the case of a flag
parsing error, and makes sets easier to parse and buffer for servers
implementing the protocol.
|
|
|
|
|
|
|
| |
allows returning cas value of the new item on set.
also fixes an extra space that was tagged onto the response line. which
I had not noticed because all of the tests were looking for a space
after the response line :( Bad copypasta from the metaget tests.
|
|
|
|
|
|
|
|
|
|
|
|
| |
needs more testing. in a "pure miss" test to help show hashing overhead,
with four worker threads and large ascii multigets there is a measurable
performance boost for longer keys. Very short keys (10-15 bytes) are
about even.
for 150ish byte keys 12m rps -> 13m rps roughly. Not too bad!
need to test hash table distribution for large sets of keys before
merging. need to consider if worth switching the defaults now or later.
|
|
|
|
|
| |
patch by @sergey-dryabzhinsky on github, but he deleted the repo so I
rewrote the commit.
|
| |
|
|
|
|
| |
if extstore wasn't enabled, crashes. Reported by @zer0e on github.
|
|
|
|
|
| |
This puts syscalls into the allow list that were triggered on latest
systems including extended usage tests, signal and systemd handling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
incorrectly.
UDP_MAX_PAYLOAD_SIZE actually contains the length of the private UDP header, but resp->tosend only contains the length of the data part.
The number of required UDP packets calculated by the original code will be less than the actual need.
E.g:
1000000/1400 = 714.2 ceil 715
1000000/1392 = 718.3 ceil 719
Actually 719 datagrams are needed, and 715 is wrong.
Signed-off-by: AK Deng <ttttabcd@protonmail.com>
|
| |
|
|
|
|
|
| |
cachedump was the only place in the codebase I can find which copied
the key verbatim. wonder when I can finally remove the command :)
|
| |
|
|
|
|
|
| |
ie: ms [key] b
if 'k' flag is given and key is binary, returns as binary encoded.
|
|
|
| |
small improvements to readme
|
|
|
|
| |
Another issue found by static code analysers
|
| |
|
| |
|
|
|
|
|
|
|
| |
conn_nread state handles c->item like an item, but allow it to be a
temporary malloced blob via setting c->item_malloced = true.
to be used for buffering value reads in the proxy code.
|
|
|
|
|
|
|
| |
new tests were flaky for slow systems; for some reason writing to the
closet socket would exit prove instead of throw any kind of error.
Instead we check that the child pid actually exits and loop a bit to
avoid the race.
|
|
|
|
| |
Detail in: https://github.com/memcached/memcached/issues/741
|
| |
|
| |
|
|
|
|
|
|
|
| |
specifying 'hash' instead of 'all' will make the LRU crawler iterate
over ever bucket in the hash table once, instead of what's in the LRU.
This also doesn't suffer from missing items because of LRU reordering
or high lock contention.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the idle thread would sleep for up to the max timeout given before
checking for active connections again. the new shutdown code waits on
threads to be joined after a shutdown signal, which could end up
hanging by the idle_timeout.
this now instead uses a cond_timedwait call to allow a condition signal
to wake up the thread to exit.
this should be done for a few other threads that sleep without
conditions (lru_maintainer?)
|
|
|
|
|
|
|
|
|
| |
if you accidentally start memcached with the same options twice,
extstore is initiated before the listener sockets and will happily
truncate its own file.
So this avoids that. Keep in mind any other process can still wipe the
file clean!
|
|
|
|
|
|
|
|
|
|
| |
in the deferred IO patch I'd cribbed some code from another PR which
turned out to use a non-portable return state from getsubopt. On BSD
systems the subopts_value string is simply empty on a non-match.
Fixing this portably looks gross but I couldn't come up with a better
option... and frankly if we're going to pass options through DSO
submodules in the future this is better anyway.
|
|
|
|
| |
was defined in memcached.c, but also used in thread.c.
|