#1034128 memcached breaks cachelib autopkgtest: TimeoutError

#1034128#5
Date:
2023-04-09 20:35:26 UTC
From:
To:
Dear maintainer(s),

With a recent upload of memcached the autopkgtest of cachelib fails in
testing when that autopkgtest is run with the binary packages of
memcached from unstable. It passes when run with only packages from
testing. In tabular form:

                        pass            fail
memcached              from testing    1.6.19-1
cachelib               from testing    0.9.0-1
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of memcached to
testing [1]. Due to the nature of this issue, I filed this bug report
against both packages. Can you please investigate the situation and
reassign the bug to the right package? [Release Team member hat on]
Because we're currently in the hard freeze for bookworm, I have marked
this bug as bookworm-ignore. Targeted fixes are still welcome.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=memcached

https://ci.debian.net/data/autopkgtest/testing/amd64/c/cachelib/32723565/log.gz

=== python3.11 ===
============================= test session starts
==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp
plugins: xprocess-0.22.2
collected 120 items / 1 skipped

tests/test_base_cache.py ............
[ 10%]
tests/test_file_system_cache.py ........................................
[ 43%]
........
[ 50%]
tests/test_interface_uniformity.py E
[ 50%]
tests/test_memcached_cache.py EEEEEEEEEEE
[ 60%]
tests/test_redis_cache.py ......................
[ 78%]
tests/test_simple_cache.py ..........................
[100%]

==================================== ERRORS
====================================
__ ERROR at setup of 
TestInterfaceUniformity.test_types_have_all_base_methods __

xprocess = <xprocess.xprocess.XProcess object at 0x7fe2098680d0>

     @pytest.fixture(scope="class")
     def memcached_server(xprocess):
         package_name = "pylibmc"
         pytest.importorskip(
             modname=package_name, reason=f"could not find python
package {package_name}"
         )
             class Starter(ProcessStarter):
             pattern = "server listening"
             args = ["memcached", "-vv"]
                 def startup_check(self):
                 out = subprocess.run(["memcached"], stderr=subprocess.PIPE)
                 return b"Address already" in out.stderr
     >       xprocess.ensure(package_name, Starter)

tests/conftest.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/xprocess/xprocess.py:282: in ensure
     if not starter.wait(log_file_handle):
/usr/lib/python3/dist-packages/xprocess/xprocess.py:399: in wait
     has_match = any(std.re.search(self.pattern, line) for line in lines)
/usr/lib/python3/dist-packages/xprocess/xprocess.py:399: in <genexpr>
     has_match = any(std.re.search(self.pattern, line) for line in lines)
/usr/lib/python3/dist-packages/xprocess/xprocess.py:405: in <genexpr>
     non_empty_lines = (x for x in lines if x.strip())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
self = <conftest.memcached_server.<locals>.Starter object at 0x7fe20a7de690>
log_file = <_io.TextIOWrapper
name='/tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp/.pytest_cache/d/.xprocess/pylibmc/xprocess.log'
mode='r' encoding='UTF-8'>

     def get_lines(self, log_file):
         """Read and yield one line at a time from log_file. Will raise
         TimeoutError if pattern is not matched before self.timeout
         seconds."""
         while True:
             line = log_file.readline()
             if not line:
                 std.time.sleep(0.1)
             if datetime.now() > self._max_time:
                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError
---------------------------- Captured stdout setup 
-----------------------------
/tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp/.pytest_cache/d/.xprocess/redis$
redis-server --port 6360
process 'redis' started pid=2393
2393:C 09 Apr 2023 15:11:50.229 # oO0OoO0OoO0Oo Redis is starting
oO0OoO0OoO0Oo

2393:C 09 Apr 2023 15:11:50.229 # Redis version=7.0.10, bits=64,
commit=00000000, modified=0, pid=2393, just started

2393:C 09 Apr 2023 15:11:50.229 # Configuration loaded

2393:M 09 Apr 2023 15:11:50.229 * Increased maximum number of open files
to 10032 (it was originally set to 1024).

2393:M 09 Apr 2023 15:11:50.229 * monotonic clock: POSIX clock_gettime

2393:M 09 Apr 2023 15:11:50.229 * Running mode=standalone, port=6360.

2393:M 09 Apr 2023 15:11:50.229 # Server initialized

2393:M 09 Apr 2023 15:11:50.229 # WARNING Memory overcommit must be
enabled! Without it, a background save or replication may fail under low
memory condition. Being disabled, it can can also cause failures without
low memory condition, see
https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add
'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run
the command 'sysctl vm.overcommit_memory=1' for this to take effect.

2393:M 09 Apr 2023 15:11:50.230 * Ready to accept connections

redis process startup detected
/tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp/.pytest_cache/d/.xprocess/pylibmc$
memcached -vv
process 'pylibmc' started pid=2399
slab class   1: chunk size        96 perslab   10922

slab class   2: chunk size       120 perslab    8738

slab class   3: chunk size       152 perslab    6898

slab class   4: chunk size       192 perslab    5461

slab class   5: chunk size       240 perslab    4369

slab class   6: chunk size       304 perslab    3449

slab class   7: chunk size       384 perslab    2730

slab class   8: chunk size       480 perslab    2184

slab class   9: chunk size       600 perslab    1747

slab class  10: chunk size       752 perslab    1394

slab class  11: chunk size       944 perslab    1110

slab class  12: chunk size      1184 perslab     885

slab class  13: chunk size      1480 perslab     708

slab class  14: chunk size      1856 perslab     564

slab class  15: chunk size      2320 perslab     451

slab class  16: chunk size      2904 perslab     361

slab class  17: chunk size      3632 perslab     288

slab class  18: chunk size      4544 perslab     230

slab class  19: chunk size      5680 perslab     184

slab class  20: chunk size      7104 perslab     147

slab class  21: chunk size      8880 perslab     118

slab class  22: chunk size     11104 perslab      94

slab class  23: chunk size     13880 perslab      75

slab class  24: chunk size     17352 perslab      60

slab class  25: chunk size     21696 perslab      48

slab class  26: chunk size     27120 perslab      38

slab class  27: chunk size     33904 perslab      30

slab class  28: chunk size     42384 perslab      24

slab class  29: chunk size     52984 perslab      19

slab class  30: chunk size     66232 perslab      15

slab class  31: chunk size     82792 perslab      12

slab class  32: chunk size    103496 perslab      10

slab class  33: chunk size    129376 perslab       8

slab class  34: chunk size    161720 perslab       6

slab class  35: chunk size    202152 perslab       5

slab class  36: chunk size    252696 perslab       4

slab class  37: chunk size    315872 perslab       3

slab class  38: chunk size    394840 perslab       2

slab class  39: chunk size    524288 perslab       2

failed to listen on TCP port 11211: Address already in use

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError
---------------------------- Captured stdout setup 
-----------------------------
/tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp/.pytest_cache/d/.xprocess/pylibmc$
memcached -vv
process 'pylibmc' started pid=2410
slab class   1: chunk size        96 perslab   10922

slab class   2: chunk size       120 perslab    8738

slab class   3: chunk size       152 perslab    6898

slab class   4: chunk size       192 perslab    5461

slab class   5: chunk size       240 perslab    4369

slab class   6: chunk size       304 perslab    3449

slab class   7: chunk size       384 perslab    2730

slab class   8: chunk size       480 perslab    2184

slab class   9: chunk size       600 perslab    1747

slab class  10: chunk size       752 perslab    1394

slab class  11: chunk size       944 perslab    1110

slab class  12: chunk size      1184 perslab     885

slab class  13: chunk size      1480 perslab     708

slab class  14: chunk size      1856 perslab     564

slab class  15: chunk size      2320 perslab     451

slab class  16: chunk size      2904 perslab     361

slab class  17: chunk size      3632 perslab     288

slab class  18: chunk size      4544 perslab     230

slab class  19: chunk size      5680 perslab     184

slab class  20: chunk size      7104 perslab     147

slab class  21: chunk size      8880 perslab     118

slab class  22: chunk size     11104 perslab      94

slab class  23: chunk size     13880 perslab      75

slab class  24: chunk size     17352 perslab      60

slab class  25: chunk size     21696 perslab      48

slab class  26: chunk size     27120 perslab      38

slab class  27: chunk size     33904 perslab      30

slab class  28: chunk size     42384 perslab      24

slab class  29: chunk size     52984 perslab      19

slab class  30: chunk size     66232 perslab      15

slab class  31: chunk size     82792 perslab      12

slab class  32: chunk size    103496 perslab      10

slab class  33: chunk size    129376 perslab       8

slab class  34: chunk size    161720 perslab       6

slab class  35: chunk size    202152 perslab       5

slab class  36: chunk size    252696 perslab       4

slab class  37: chunk size    315872 perslab       3

slab class  38: chunk size    394840 perslab       2

slab class  39: chunk size    524288 perslab       2

failed to listen on TCP port 11211: Address already in use

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError
_____ ERROR at setup of 
TestMemcachedCache.test_delete_many_ignore_errors ______

xprocess = <xprocess.xprocess.XProcess object at 0x7fe2098680d0>

     @pytest.fixture(scope="class")
     def memcached_server(xprocess):
         package_name = "pylibmc"
         pytest.importorskip(
             modname=package_name, reason=f"could not find python
package {package_name}"
         )
             class Starter(ProcessStarter):
             pattern = "server listening"
             args = ["memcached", "-vv"]
                 def startup_check(self):
                 out = subprocess.run(["memcached"], stderr=subprocess.PIPE)
                 return b"Address already" in out.stderr
     >       xprocess.ensure(package_name, Starter)

tests/conftest.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/xprocess/xprocess.py:282: in ensure
     if not starter.wait(log_file_handle):
/usr/lib/python3/dist-packages/xprocess/xprocess.py:399: in wait
     has_match = any(std.re.search(self.pattern, line) for line in lines)
/usr/lib/python3/dist-packages/xprocess/xprocess.py:399: in <genexpr>
     has_match = any(std.re.search(self.pattern, line) for line in lines)
/usr/lib/python3/dist-packages/xprocess/xprocess.py:405: in <genexpr>
     non_empty_lines = (x for x in lines if x.strip())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
self = <conftest.memcached_server.<locals>.Starter object at 0x7fe2095c9150>
log_file = <_io.TextIOWrapper
name='/tmp/autopkgtest-lxc.wypz897y/downtmp/autopkgtest_tmp/.pytest_cache/d/.xprocess/pylibmc/xprocess.log'
mode='r' encoding='UTF-8'>

     def get_lines(self, log_file):
         """Read and yield one line at a time from log_file. Will raise
         TimeoutError if pattern is not matched before self.timeout
         seconds."""
         while True:
             line = log_file.readline()
             if not line:
                 std.time.sleep(0.1)
             if datetime.now() > self._max_time:
                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError

                     "The provided start pattern {} could not be matched \
                     within the specified time interval of {}
seconds".format(
                         self.pattern, self.timeout
                     )
                 )
E               TimeoutError: The provided start pattern server
listening could not be matched                     within the specified
time interval of 120 seconds

/usr/lib/python3/dist-packages/xprocess/xprocess.py:422: TimeoutError
=========================== short test summary info
============================
ERROR
tests/test_interface_uniformity.py::TestInterfaceUniformity::test_types_have_all_base_methods
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_has -
TimeoutEr...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_clear -
Timeout...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_set_get -
Timeo...
ERROR
tests/test_memcached_cache.py::TestMemcachedCache::test_set_get_many - ...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_get_dict -
Time...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_delete -
Timeou...
ERROR
tests/test_memcached_cache.py::TestMemcachedCache::test_delete_many - T...
ERROR
tests/test_memcached_cache.py::TestMemcachedCache::test_delete_many_ignore_errors
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_add -
TimeoutEr...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_inc_dec -
Timeo...
ERROR tests/test_memcached_cache.py::TestMemcachedCache::test_expiration
- Ti...
============ 108 passed, 1 skipped, 12 errors in 282.32s (0:04:42)
=============
autopkgtest [15:16:11]: test upstream

#1034128#14
Date:
2023-04-10 11:15:26 UTC
From:
To:
Paul Gevers wrote:
[..]

Not sure what is going on here. However, I am dumping some links that I
came across so far:

* memcached release notes: https://github.com/memcached/memcached/wiki/ReleaseNotes1619
* cachelib release notes: https://cachelib.readthedocs.io/en/stable/changes/
* A similar-looking report on cachelib's Issue Page: https://github.com/pallets-eco/cachelib/issues/39


Regards,

#1034128#19
Date:
2023-06-05 21:06:24 UTC
From:
To:
The problem is that 1.6.19-1 is listening on ipv6 as well, and that
makes the test suite fail to start another copy due to "address
already in use":

@@__xproc_block_delimiter__@@
slab class 1: chunk size 96 perslab 10922
(...)
failed to listen on TCP port 11211: Address already in use

1.6.18-1 only listened on 127.0.0.1:11211.

Best way to fix? Not sure yet. Maybe kill the system-provided
memcached before running the test? That might need to have the test
run as root, at least to execute that action, which is annoying...

#1034128#24
Date:
2023-06-11 13:49:42 UTC
From:
To:
Quick MP at https://salsa.debian.org/python-team/packages/cachelib/-/merge_requests/1
#1034128#31
Date:
2023-06-18 16:34:55 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
cachelib, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1034128@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sergio Durigan Junior <sergiodj@debian.org> (supplier of updated cachelib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 18 Jun 2023 12:09:55 -0400
Source: cachelib
Architecture: source
Version: 0.9.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Sergio Durigan Junior <sergiodj@debian.org>
Closes: 1034128
Changes:
 cachelib (0.9.0-2) unstable; urgency=medium
 .
   * Team upload.
   * d/control: Bump Standards-Version to 4.6.2; no changes needed.
 .
   [ Andreas Hasenack ]
   * Stop memcached before the DEP8 test is run.
     The "upstream" DEP8 test spawns its own memcached process for the test,
     which conflicts with the system-wide one.
     - d/t/control: add needs-root restriction
     - d/t/upstream: stop the system memcached, and run the test as an
       unprivileged user as before (Closes: #1034128).
       Use --supported py3 versions.
       Fixes declare-python-versions-for-test lintian warning.
Checksums-Sha1:
 4ac20128c6907c71bec019a530718c9819bf6522 2807 cachelib_0.9.0-2.dsc
 878e31b8370321103d785f4ce77feaaa43badd39 4348 cachelib_0.9.0-2.debian.tar.xz
 db8f70bd675b6778d833715ddbbbf1e118600e0b 9151 cachelib_0.9.0-2_amd64.buildinfo
Checksums-Sha256:
 5b843720c14aa0d56bac784a84fa053738b12c08d128ce4eeaf1d1464bcefe0b 2807 cachelib_0.9.0-2.dsc
 f3f35b73e6523cf6817333c61fd1f0bfabb9ae3c7948558ad692a7cb36b57e31 4348 cachelib_0.9.0-2.debian.tar.xz
 ef1212d5d2ff63bc9b0a956ec83e3d078f579378d3ab24fabfaf40ef1745f141 9151 cachelib_0.9.0-2_amd64.buildinfo
Files:
 4fbf312eed525f6fee516d4f8961c66c 2807 python optional cachelib_0.9.0-2.dsc
 41c198eb139923e1eca9a79f1c149942 4348 python optional cachelib_0.9.0-2.debian.tar.xz
 e20b174548ecbe0f96e318b531a7ac5c 9151 python optional cachelib_0.9.0-2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEI3pUsQKHKL8A7zH00Ot2KGX8XjYFAmSPLpAUHHNlcmdpb2Rq
QGRlYmlhbi5vcmcACgkQ0Ot2KGX8XjYXMBAAkW9xBYtO/EEuPL8Wr9l/aKt+9HHz
+xtXXPzX65o9C8e+mawJaFxsnHAcYaGiMnBy7488EHpNtGnzDMGnOoG/6PKTX04+
iNK9i38SjfYSVSnm89ctfGg4svzXgrhwznIYjIvnntFwRsEwwSygtXMC4DP008En
953nd2t9S7sLUVJgWXcocZLH0FYG9rBsMX7LrLPA/XV13hqo1I9BQbcuZk/HRTu4
MZRHl0uIuozT3t2CqzfGZhB8lo7UfcPsnlYa8iUb0X/xyU6pWV8LUDAYEUC1Ydja
B2g6ExHSv44i76O8dfVp/fPHt/ZZ2uEohZK5G8IZ7JrwoMqJVC2CjvWh7M4LoHV8
z/Oe1/If12/XqudJMfFIRzG24fctq4ag0kCp9a6b0jRvLdkukJWW7c3b6tBLz5EN
1QpziVnmFmNY8zdQ4q2DeYHfhTmClx2vdLV0aWa2QRyb407XorVpjYh0hKaFtLy8
OU1CIWdeSHUEcqE1NySjnnViF5Uf+ge13IMi6pjTLenhzst/Va6DeIKm9/YCurgh
cnI87mdyRlQkAUy6QV13ceeJmDoIlo5TPKL3iWpRA917w5kdhCMJpLD2woOdWOaG
A02eTe3NxD9VKl04xXj7IlT1h7aZoQc4UsXrkdEU3U+6/nMlu7L6kpDRSMWN+XjL
c4iNxiuWeNE4gYE=
=vs74
-----END PGP SIGNATURE-----

#1034128#36
Date:
2023-06-18 18:27:14 UTC
From:
To:
unsubscribe
#1034128#41
Date:
2023-06-18 20:16:16 UTC
From:
To:
The BTS keeps assuming the bug is in memcached too otherwise.