Found major bug in OLS

#1
After several months testing

I believe I found the error with the help of chatgpt – OLS has something wrong with the logic in managing lsphp connections (closing child lsphp connections to MariaDB). It’s trying to ‘kill” processes which are already closed. I believe this can cause MariaDB errors to keep appearing. Also kill is not a graceful way to close the lsphp connection.


2023-07-16 00:28:43.154788 [NOTICE] [47911] [AdminPHP] add child process pid: 48003

2023-07-16 00:29:14.096402 [NOTICE] [47911] sendKillCmdToWatchdog: 'extappkill:48003:-3:0'.

2023-07-16 00:29:14.800521 [NOTICE] [47909] Cmd from child: [extappkill:48003:-3:0]

2023-07-16 00:29:14.800556 [INFO] [47909] Failed to get process [48003] start time, not running, skip killing.

2023-07-16 00:29:36.555143 [NOTICE] [47914] [LocalWorker::workerExec] Config[lsphp81]: suExec uid 65534 gid 65534 cmd /usr/local/lsws/lsphp81/bin/lsphp, final uid 65534 gid 65534, flags: 0.

2023-07-16 00:29:36.555502 [NOTICE] [47914] [lsphp81] add child process pid: 48022

2023-07-16 00:29:44.047614 [NOTICE] [47911] [LocalWorker::workerExec] VHost:_AdminVHost suExec check uid 998 gid 65534 setuidmode 2.

2023-07-16 00:29:44.047629 [INFO] [47911] [LocalWorker::workerExec] VHost:_AdminVHost suExec check uid 998 gid 65534 setuidmode 2.

2023-07-16 00:29:44.047636 [NOTICE] [47911] [LocalWorker::workerExec] Config[AdminPHP]: suExec uid -1 gid -1 cmd /usr/local/lsws/admin/fcgi-bin/admin_php -c ../conf/php.ini, final uid 998 gid 65534, flags: 0.

2023-07-16 00:29:44.047988 [NOTICE] [47911] [AdminPHP] add child process pid: 48023

2023-07-16 00:30:15.079942 [NOTICE] [47911] sendKillCmdToWatchdog: 'extappkill:48023:-3:0'.

2023-07-16 00:30:15.800506 [NOTICE] [47909] Cmd from child: [extappkill:48023:-3:0]

2023-07-16 00:30:15.800544 [INFO] [47909] Failed to get process [48023] start time, not running, skip killing.

The result is mariadb is constantly spammed with errors as such

2023-07-16 0:47:06 704921 [Warning] Aborted connection 704921 (Got an error reading communication packets)
2023-07-16 0:47:07 704931 [Warning] Aborted connection 704931 (Got an error reading communication packets)
2023-07-16 0:47:08 704935 [Warning] Aborted connection 704935 (Got an error reading communication packets)
2023-07-16 0:47:08 704934 [Warning] Aborted connection 704934 (Got an error reading communication packets)
2023-07-16 0:47:08 704941 [Warning] Aborted connection 704941 (Got an error reading communication packets)
 
#2
Update: It seems everytime the lsphp child process is terminated by OLS -

2023-07-16 21:24:57.082381 [NOTICE] [120009] [lsphp81] Send SIGTERM to process [139211].

I am getting a mariadb error. This started only on the newest version of lsws. It has nothing to do with timeouts.

2023-07-16 21:24:57 1588 [Warning] Aborted connection 1588 (Got an error reading communication packets)

Running on

Ubuntu 22
lsphp8.1
mariadb 10.6.12
wordpress core
 
Top