seafile-controller tries to start another copy of seaf-server in a loop flooding seafile.log log file
Env:
OS: CentOS Linux release 7.1.1503 (Core)
Kernel: 3.10.0-327.3.1.el7.x86_64
Seafile: 4.4.7 pro edition
Description:
Hi,
I have faced with the problem when seafile-server component unable to start within 10 seconds (hard coded CHECK_PROCESS_INTERVAL variable) which is caused by a slow network connectivity to the remote database server. This leads to improper execution of the second copy of seafile-server process which
removes pid file located in pids/seaf-server.pid and tries to start in an infinite loop flooding logs/seafile.log log file.
Average database latency for single WRITE query is about 0.3-0.6 seconds.
I see that when seafile-server starts it tries to create several database tables:
# grep CREATE /tmp/strace/controller.44199
13:03:56 write(16, "\207\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 139) = 139
13:03:57 write(16, "L\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 80) = 80
13:03:57 write(16, "y\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 125) = 125
13:03:58 write(16, "\311\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 205) = 205
13:03:58 write(16, "h\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 108) = 108
13:03:58 write(16, "\263\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 183) = 183
13:03:59 write(16, "\334\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 224) = 224
13:03:59 write(16, "\216\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 146) = 146
13:03:59 write(16, "\232\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 158) = 158
13:04:00 write(16, "\250\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 172) = 172
13:04:00 write(16, "i\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 109) = 109
13:04:01 write(16, "v\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 122) = 122
13:04:01 write(16, "f\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 106) = 106
13:04:01 write(16, "h\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 108) = 108
13:04:02 write(16, "g\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 107) = 107
13:04:03 write(16, "\235\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 161) = 161
13:04:03 write(16, "U\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 89) = 89
13:04:03 write(16, "]\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 97) = 97
13:04:04 write(16, "\217\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 147) = 147
13:04:04 write(16, "\250\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 172) = 172
13:04:05 write(16, "\250\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 172) = 172
13:04:05 write(16, "m\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 113) = 113
13:04:05 write(16, "\342\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 230) = 230
13:04:06 write(16, "p\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 116) = 116
13:04:06 write(16, "\216\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 146) = 146
13:04:07 write(16, "`\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 100) = 100
13:04:07 write(16, "e\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 105) = 105
13:04:07 write(16, "\\\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 96) = 96
13:04:08 write(16, "\202\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 134) = 134
13:04:09 write(16, "\263\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 183) = 183
13:04:10 write(16, "i\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 109) = 109
13:04:10 write(16, "\361\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 245) = 245
13:04:10 write(16, "\207\0\0\0\3CREATE TABLE IF NOT EXISTS "..., 139) = 139
# grep -c CREATE controller.44199
33
So as you can see the start up time could take up to 15 seconds (from 13:03:56 to 13:04:10).
But after 10 seconds (CHECK_PROCESS_INTERVAL) seafile-controller checks pids/seaf-server.pid pidfile which still doesn't exist and starts another seafile-server process which fails to bind to socket because it's already in use and removes valid pidfile of the first process which have already appeared by this time.
Here are log files cuts:
seafile.log
http-server.c(2364): Could not bind socket: Address already in use
Problem:
seafile-controller tries to start another copy of seaf-server in a loop flooding
seafile.log
log fileEnv:
OS:
CentOS Linux release 7.1.1503 (Core)
Kernel:3.10.0-327.3.1.el7.x86_64
Seafile:4.4.7 pro edition
Description:
Hi, I have faced with the problem when
seafile-server
component unable to start within 10 seconds (hard codedCHECK_PROCESS_INTERVAL
variable) which is caused by a slow network connectivity to the remote database server. This leads to improper execution of the second copy ofseafile-server
process which removes pid file located inpids/seaf-server.pid
and tries to start in an infinite loop floodinglogs/seafile.log
log file.Average database latency for single WRITE query is about 0.3-0.6 seconds.
I see that when
seafile-server
starts it tries to create several database tables:So as you can see the start up time could take up to 15 seconds (from 13:03:56 to 13:04:10). But after 10 seconds (CHECK_PROCESS_INTERVAL)
seafile-controller
checkspids/seaf-server.pid
pidfile which still doesn't exist and starts anotherseafile-server
process which fails to bind to socket because it's already in use and removes valid pidfile of the first process which have already appeared by this time.Here are log files cuts: