Commit Graph

17 Commits

Author SHA1 Message Date
Avi Kivity
f2e25b8442 Merge branch 'shared_ptr'
Split shared_ptr into a traditional polymorphic shared_ptr implementation,
and a lighter-weight, non polymorphic lw_shared_ptr.
2015-01-05 11:29:35 +02:00
Avi Kivity
87f63f7b90 shared_ptr: rename to lw_shared_ptr (for light-weight)
The current shared_ptr implementation is efficient, but does not support
polymorphic types.

Rename it in order to make room for a polymorphic shared_ptr.
2015-01-04 22:38:49 +02:00
Shlomi Livne
b7a83903b5 tests: terminate memcached instance with SIGTERM
Terminate a running memcached instance with a SIGTERM instead of a
SIGKILL to allow the process to close in a cleaner manner

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-01-04 17:17:40 +02:00
Tomasz Grabiec
c2fe4c3e29 memcached/tests.py: wait for memcached process before proceeding
To ensure that the old process is no longer running when the new one
is started.
2014-12-30 17:00:44 +02:00
Tomasz Grabiec
16f4b7dec7 tests: make test_response_spanning_many_datagrams immune to value order 2014-12-16 16:30:50 +02:00
Tomasz Grabiec
7fd878b1ed tests: memcached: fix test_mutliple_keys_in_get()
Values may be reported in different order than the order of keys in
the request.
2014-12-04 13:37:35 +01:00
Tomasz Grabiec
411e6c1b02 tests: memcached: add test checking splitting of large responses 2014-12-04 13:37:35 +01:00
Tomasz Grabiec
c262060d92 memcache: avoid vprintf()
Improves memaslap UDP posix throughput on my laptop by 40% (from 73k to 105k).

When item is created we cache flags and size part of the response so
that there's no need to call expensive string formatting in get(). The
down side is that this pollutes "item" object with protocol-specific
field, but since ASCII is the only protocol which is supported now and
it's not like we can't fix it later, I think it's fine.
2014-11-13 22:22:07 +02:00
Tomasz Grabiec
6913079927 tests: memcache: do not constrain tests to 1 CPU 2014-11-11 13:52:23 +02:00
Tomasz Grabiec
b0dd9e736c memcached: SMP support
There is a separate DB per core, each serving a subset of the key
space. From the outside in appears to behave as one DB.

item_key type was changed to include the hash so that we calculate the
hash only once. The same hash is used for sharding and hashing. No
need for store_hash<> option on unordered_set<> any more.

Some seastar-specific and hashtable-specific stats were moved from the
general "stats" command into "stats hash", which shows per-core
statistics.
2014-11-11 13:52:23 +02:00
Tomasz Grabiec
26361873bc test_ascii_parser: fix potential use-after-free error 2014-11-06 15:48:31 +02:00
Tomasz Grabiec
ca85016556 tests: memcache: fix regex
Some versions of python do not tolerate this regex:

   r'(\w*)?'

ERROR: test_incr (__main__.TestCommands)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/memcached/test_memcached.py", line 464, in test_incr
    self.assertRegexpMatches(call('incr key 1\r\n').decode(), r'0(\w*)?\r\n')
  File "/usr/lib64/python3.3/unittest/case.py", line 1178, in deprecated_func
    return original_func(*args, **kwargs)
  File "/usr/lib64/python3.3/unittest/case.py", line 1153, in assertRegex
    expected_regex = re.compile(expected_regex)
  File "/usr/lib64/python3.3/re.py", line 214, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python3.3/re.py", line 281, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 498, in compile
    code = _code(p, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 483, in _code
    _compile(code, p.data, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 75, in _compile
    elif _simple(av) and op is not REPEAT:
  File "/usr/lib64/python3.3/sre_compile.py", line 362, in _simple
    raise error("nothing to repeat")
sre_constants.error: nothing to repeat
2014-10-30 10:17:52 +02:00
Avi Kivity
b1ec66900f memcached: reindent ascii parser test 2014-10-28 11:04:45 +02:00
Avi Kivity
90cb9376ab memcached: enhance test to check for differently scattered packets
Use funky indentation to reduce diff size; can be adjutsed later.
2014-10-28 11:01:37 +02:00
Tomasz Grabiec
3eaac67a09 tests: memcache: make test_connection_statistics a bit more robust
It some times fails because the server records connection closure with
a delay.
2014-10-21 16:43:09 +02:00
Tomasz Grabiec
f921a9787b tests: make test_memcache.py return non-zero exit code on failure 2014-10-21 16:43:09 +02:00
Pekka Enberg
6723c0cbdd apps/memcache => apps/memcached
The protocol is called the "memcache protocol" but the server should
follow the same naming convention as httpd does.

It should not be a big deal but it annoys the hell out of simple people
like myself who have their brain hard-wired to type the final "d"...

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-10-21 17:30:14 +03:00