[horde] Upgrading to PHP 7 with redis - lock problem?

Michael Menge michael.menge at zdv.uni-tuebingen.de
Mon Apr 5 09:12:05 UTC 2021


Hi

Quoting Jan Schneider <jan at horde.org>:

> Zitat von Ralf Lang <lang at b1-systems.de>:
>
>> Hello,
>>
>> Am 23.03.21 um 14:49 schrieb Frank Richter:
>>> Hi,
>>>
>>> I'm about to upgrade a Horde system to PHP 7.4. We're using redis as
>>> hashtable with PHP Predis.
>>> We're experiencing locks from time to time: httpd's go up to the
>>> limit, browsers get no data.
>>>
>>> redis-cli monitor shows all the time:
>>> "SETNX" "hht_3db37b5e6a34230ee38cd5a8…_l" "1"
>>>
>>> This looks like a lock all the processes are waiting for. DELeting
>>> this key solves the situation.
>>>
>>> Looking for the cause I saw:
>>>
>>> [Tue Mar 23 09:02:57.541681 2021] [php7:error] [pid 56021]
>>> [client…:53783] PHP Fatal error: Uncaught Predis\\ClientException:
>>> Command 'EXiSTS' is not a registered Redis command. in
>>> /usr/share/pear/Predis/Profile/RedisProfile.php:88\nStack trace:\n#0
>>> /usr/share/pear/Predis/Client.php(323):
>>> Predis\\Profile\\RedisProfile->createCommand()\n#1
>>> /usr/share/pear/Predis/Client.php(314):
>>> Predis\\Client->createCommand()\n#2
>>> /usr/share/pear/Horde/HashTable/Predis.php(136):
>>> Predis\\Client->__call()\n#3
>>> /usr/share/pear/Horde/HashTable/Base.php(276):
>>> Horde_HashTable_Predis->_set()\n#4
>>> /usr/share/pear/Horde/SessionHandler/Storage/Hashtable.php(125):
>>> Horde_HashTable_Base->set()\n#5
>>> /usr/share/pear/Horde/SessionHandler.php(197):
>>> Horde_SessionHandler_Storage_Hashtable->write()\n#6 [internal
>>> function]: Horde_SessionHandler->write()\n#7
>>> /usr/share/pear/Horde/SessionHandler.php(114):
>>> session_write_close()\n#8 [internal function]:
>>> Horde_SessionHandler->__destruct()\n#9 {main}\n  thrown in
>>> /usr/share/pear/Predis/Profile/RedisProfile.php on line 88, referer: …
>>>
>>> Googling leads to:
>>> https://stackoverflow.com/questions/60701260/how-can-i-solve-predis-clientexception-command-exists-is-not-a-registered
>>>
>>> „It is a locale issue. I believe you are using Turkish locale in your
>>> app. And that causes issues with strtoupper function.“
>>> strtoupper('exists') with Turkish locale leads to 'EXiSTS'.
>>>
>>> And indeed, locale tr_TR is supported in PHP 7 according to
>>> horde/config/nls.php
>>>
>>> if (version_compare(PHP_VERSION, '5.5', 'ge')) {
>>>     $horde_nls_config['aliases']['tr'] = 'tr_TR';
>>>     …
>>>
>>> Using https://ser.name/login.php?new_lang=tr_TR I can trigger this lock.
>>>
>>> Is anyone seeing this as well? Is disabling tr_TR the only solution in
>>> the moment?
>> It might make sense to wrap all predis calls in horde\hashtable\predis
>> into blocks changing locale and restoring afterwards. However, I have no
>> idea about performance implications.
>
> A better solution would be if Predis used a locale-safe strtoupper  
> implementation.

There is already a report from 216 in the Redis bug tracker  
https://github.com/predis/predis/issues/372 .
But the ticke is still open



--------------------------------------------------------------------------------
Michael Menge                          Tel.: (49) 7071 / 29-70316
Universität Tübingen                   Fax.: (49) 7071 / 29-5912
Zentrum für Datenverarbeitung          mail:  
michael.menge at zdv.uni-tuebingen.de
Wächterstraße 76
72074 Tübingen



More information about the horde mailing list