Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPT_NOREPLY: touch() stuck forever #542

Open
killerbees19 opened this issue Jul 13, 2023 · 0 comments
Open

OPT_NOREPLY: touch() stuck forever #542

killerbees19 opened this issue Jul 13, 2023 · 0 comments

Comments

@killerbees19
Copy link

killerbees19 commented Jul 13, 2023

Example code:

<?php

$mc = new Memcached();
$mc->addServer('localhost', 11211);
$mc->setOptions([Memcached::OPT_NOREPLY => true]);
$mc->touch('test', 120);

Now it's stuck at 100% CPU usage until the process gets killed. Without OPT_NOREPLY everything is fine. Both protocols (text/binary) are affected by this bug.

strace output:

connect(3, {sa_family=AF_INET, sin_port=htons(11211), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=3, events=POLLOUT}], 1, 4000) = 1 ([{fd=3, revents=POLLOUT}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
sendto(3, "touch test 120\r\n", 16, MSG_NOSIGNAL, NULL, 0) = 16
recvfrom(3, "NOT_FOUND\r\n", 8196, MSG_NOSIGNAL, NULL, NULL) = 11
write(1, "bool(true)\n", 11bool(true)
)            = 11
write(1, "bool(false)\n", 12bool(false)
)           = 12
sendto(3, "quit\r\n", 6, MSG_NOSIGNAL, NULL, 0) = 6
recvfrom(3, "", 8196, MSG_NOSIGNAL, NULL, NULL) = 0
shutdown(3, SHUT_RDWR)                  = 0
close(3)                                = 0
connect(3, {sa_family=AF_INET, sin_port=htons(11211), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=3, events=POLLOUT}], 1, 4000) = 1 ([{fd=3, revents=POLLOUT}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
sendto(3, "\200\34\0\4\4\0\0\0\0\0\0\10\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0xtest", 32, MSG_NOSIGNAL, NULL, 0) = 32
recvfrom(3, "\201\34\0\0\0\0\0\1\0\0\0\t\0\1\0\0\0\0\0\0\0\0\0\0Not foun"..., 8196, MSG_NOSIGNAL, NULL, NULL) = 33
write(1, "bool(true)\n", 11bool(true)
)            = 11
write(1, "bool(false)\n", 12bool(false)
)           = 12
sendto(3, "\200\7\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0\0", 24, MSG_NOSIGNAL, NULL, 0) = 24
recvfrom(3, "\201\7\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0\0", 8196, MSG_NOSIGNAL, NULL, NULL) = 24
recvfrom(3, "", 8196, MSG_NOSIGNAL, NULL, NULL) = 0
shutdown(3, SHUT_RDWR)                  = 0
close(3)                                = 0

Tested at Debian 11 (amd64) with PHP 5.6 to 8.2 (deb.sury.org)

libmemcached11       1.0.18-4.2                                  
php5.6-memcached     1:2.2.0-1+0~20230619.3+debian11~1.gbpaf2604 
php7.0-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php7.1-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php7.2-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php7.3-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php7.4-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php8.0-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php8.1-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
php8.2-memcached     3.2.0++-1+0~20230622.54+debian11~1.gbp8f3995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant