No duplicates 🥲.
- [X] I have searched for a similar issue in our bug tracker and didn't find any solutions.
What happened?
Sometimes i faced with issue when rr doesn't start workers after resetting
I use the command for reloading application after deploying new version
php -r '
require_once "/var/www/..../vendor/autoload.php";
$rpc = \Spiral\Goridge\RPC\RPC::create("tcp://127.0.0.1:6001");
$rpc->call("resetter.Reset", "http");
' 2> /dev/null && echo "roadrunner restarted"
And this works fine. In logs of the roadrunner, i can find such logs.
{"level":"info","ts":1654876751.0767014,"logger":"http","msg":"HTTP plugin got restart request. Restarting..."}
{"level":"debug","ts":1654876751.482103,"logger":"server","msg":"worker constructed","pid":18535}
{"level":"debug","ts":1654876751.7076323,"logger":"server","msg":"worker constructed","pid":18539}
{"level":"debug","ts":1654876751.92825,"logger":"server","msg":"worker constructed","pid":18543}
{"level":"debug","ts":1654876752.1424391,"logger":"server","msg":"worker constructed","pid":18547}
{"level":"debug","ts":1654876752.3567128,"logger":"server","msg":"worker constructed","pid":18551}
{"level":"debug","ts":1654876752.5836997,"logger":"server","msg":"worker constructed","pid":18555}
{"level":"debug","ts":1654876752.7970486,"logger":"server","msg":"worker constructed","pid":18569}
{"level":"debug","ts":1654876753.012394,"logger":"server","msg":"worker constructed","pid":18573}
{"level":"debug","ts":1654876753.2264977,"logger":"server","msg":"worker constructed","pid":18579}
{"level":"debug","ts":1654876753.439048,"logger":"server","msg":"worker constructed","pid":18583}
{"level":"debug","ts":1654876753.6546476,"logger":"server","msg":"worker constructed","pid":18587}
{"level":"debug","ts":1654876753.8703601,"logger":"server","msg":"worker constructed","pid":18591}
{"level":"info","ts":1654876753.8704066,"logger":"http","msg":"HTTP workers Pool successfully restarted"}
{"level":"info","ts":1654876753.8704116,"logger":"http","msg":"HTTP handler listeners successfully re-added"}
{"level":"info","ts":1654876753.8704147,"logger":"http","msg":"HTTP plugin successfully restarted"}
But sometimes when i tried to reload workers i faced with unexpected behavior when rr doesn't construct new workers
{"level":"info","ts":1654865797.447119,"logger":"http","msg":"HTTP plugin got restart request. Restarting..."}
{"level":"debug","ts":1654865947.0437615,"logger":"rpc","msg":"Started RPC service","address":"tcp://127.0.0.1:6001","plugins":["informer","resetter"]}
{"level":"debug","ts":1654865947.3511188,"logger":"server","msg":"worker constructed","pid":26076}
{"level":"debug","ts":1654865947.6003292,"logger":"server","msg":"worker constructed","pid":26090}
{"level":"debug","ts":1654865947.8625834,"logger":"server","msg":"worker constructed","pid":26094}
{"level":"debug","ts":1654865948.083429,"logger":"server","msg":"worker constructed","pid":26098}
{"level":"debug","ts":1654865948.2959368,"logger":"server","msg":"worker constructed","pid":26102}
{"level":"debug","ts":1654865948.5081518,"logger":"server","msg":"worker constructed","pid":26106}
{"level":"debug","ts":1654865948.7213166,"logger":"server","msg":"worker constructed","pid":26110}
{"level":"debug","ts":1654865948.9349105,"logger":"server","msg":"worker constructed","pid":26114}
{"level":"debug","ts":1654865949.1486824,"logger":"server","msg":"worker constructed","pid":26118}
{"level":"debug","ts":1654865949.3617551,"logger":"server","msg":"worker constructed","pid":26122}
{"level":"debug","ts":1654865949.5777884,"logger":"server","msg":"worker constructed","pid":26127}
{"level":"debug","ts":1654865949.7925146,"logger":"server","msg":"worker constructed","pid":26131}
Construction of new workers was after restarting the service
And that's all. It seems like reload plugin was stopped by something. After that, i need to restart the service completely.
Also, i have such logs in syslog that appeared after restarting the service, but i don't know does it relate to the issue or not
rr[24396]: panic: runtime error: invalid memory address or nil pointer dereference
rr[24396]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xd77dbd]
rr[24396]: goroutine 55954476 [running]:
rr[24396]: github.com/spiral/roadrunner-plugins/v2/http.(*Plugin).workers(...)
rr[24396]: #011github.com/spiral/roadrunner-plugins/[email protected]/http/plugin.go:358
rr[24396]: github.com/spiral/roadrunner-plugins/v2/http.(*Plugin).Workers(0x1529d40)
rr[24396]: #011github.com/spiral/roadrunner-plugins/[email protected]/http/plugin.go:342 +0xbd
rr[24396]: github.com/spiral/roadrunner-plugins/v2/informer.(*Plugin).Workers(...)
rr[24396]: #011github.com/spiral/roadrunner-plugins/[email protected]/informer/plugin.go:38
rr[24396]: github.com/spiral/roadrunner-plugins/v2/informer.(*rpc).Workers(0x2, {0xc000d5f490, 0x1}, 0xc000da9b78)
rr[24396]: #011github.com/spiral/roadrunner-plugins/[email protected]/informer/rpc.go:31 +0x5e
rr[24396]: reflect.Value.call({0xc0007b7500, 0xc00000f1b0, 0x13}, {0x17222dd, 0x4}, {0xc000befef8, 0x3, 0x3})
rr[24396]: #011reflect/value.go:543 +0x814
rr[24396]: reflect.Value.Call({0xc0007b7500, 0xc00000f1b0, 0x0}, {0xc000db46f8, 0x3, 0x3})
rr[24396]: #011reflect/value.go:339 +0xc5
rr[24396]: net/rpc.(*service).call(0xc0007a3700, 0xc000db47b0, 0xd79dd9, 0xc000d5ede0, 0xc0007ba300, 0xc000774360, {0x14c2860, 0xc000f168e0, 0x15ef4e0}, {0x156fa00, ...}, ...)
rr[24396]: #011net/rpc/server.go:377 +0x239
rr[24396]: created by net/rpc.(*Server).ServeCodec
rr[24396]: #011net/rpc/server.go:474 +0x405
systemd[1]: rr.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: rr.service: Failed with result 'exit-code'.
systemd[1]: Stopped High-performance PHP application server.
systemd[1]: Started High-performance PHP application server.
PHP7.4 (opcache_cli enabled without storing in files)
Ubuntu 18.04 x86_64
rr version 2.5.7 (build time: 2021-11-13T16:43:25+0000, go1.17.2)
server:
command: 'php /var/www/...../worker.php'
relay: 'pipes'
rpc:
listen: tcp://127.0.0.1:6001
http:
address: 10.0.6.50:80
pool:
max_jobs: 50000
num_workers: 12
logs:
mode: production
level: debug
file_logger_options:
log_output: /var/log/rr/access.log
max_size: 100
max_age: 48
compress: true
Maybe i do something wrong when i try to reload workers?
Thank you for any help.
Version
2.5.7
Relevant log output
No response
B-bug F-need-verification