roadrunner: [BUG] Workers not restarting after stop
We have a local rr build to run our services with such config file
rpc:
listen: tcp://127.0.0.1:6001
server:
# Worker starting command, with any required arguments.
#
# This option is required.
command: "php ./vendor/bin/rr-worker start --refresh-app --relay-dsn tcp://127.0.0.1:6001"
# User name (not UID) for the worker processes. An empty value means to use the RR process user.
#
# Default: ""
user: ""
# Group name (not GID) for the worker processes. An empty value means to use the RR process user.
#
# Default: ""
group: ""
# Worker relay can be: "pipes", TCP (eg.: tcp://127.0.0.1:6001), or socket (eg.: unix:///var/run/rr.sock).
#
# Default: "pipes"
relay: tcp://127.0.0.1:6001
# Timeout for relay connection establishing (only for socket and TCP port relay).
#
# Default: 60s
relay_timeout: 60s
logs:
# default
mode: development
level: debug
encoding: console
output: stdout
err_output: stdout
channels:
http:
mode: development
level: debug
encoding: console
output: stdout
server:
mode: development
level: debug
encoding: console
output: stdout
rpc:
mode: development
level: debug
encoding: console
output: stdout
http:
address: "0.0.0.0:80"
# middlewares for the http plugin, order matters
middleware: ["static", "gzip", "headers"]
# uploads
uploads:
forbid: [".php", ".exe", ".bat"]
trusted_subnets:
[
"10.0.0.0/8",
"127.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"::1/128",
"fc00::/7",
"fe80::/10",
]
# headers (middleware)
headers:
cors:
allowed_origin: "*"
allowed_headers: "*"
allowed_methods: "GET,POST,PUT,PATCH,DELETE"
allow_credentials: true
exposed_headers: "Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma"
max_age: 600
# http static (middleware)
static:
dir: "public"
forbid: [".php"]
pool:
# default - num of logical CPUs
num_workers: 4
# default 0 - no limit
max_jobs: 1
# default 1 minute
allocate_timeout: 60s
# default 1 minute
destroy_timeout: 60s
# supervisor used to control http workers
supervisor:
# watch_tick defines how often to check the state of the workers (seconds)
watch_tick: 1s
# ttl defines maximum time worker is allowed to live (seconds)
ttl: 0
# idle_ttl defines maximum duration worker can spend in idle mode after first use. Disabled when 0 (seconds)
idle_ttl: 10s
# exec_ttl defines maximum lifetime per job (seconds)
exec_ttl: 10s
# max_worker_memory limits memory usage per worker (MB)
max_worker_memory: 100
ssl:
# host and port separated by semicolon (default :443)
address: :443
redirect: false
# ssl cert
cert: /ssl-cert/self-signed.crt
# ssl private key
key: /ssl-cert/self-signed.key
# HTTP service provides HTTP2 transport
http2:
h2c: false
max_concurrent_streams: 128
# Automatically detect PHP file changes and reload connected services (docs:
# https://roadrunner.dev/docs/beep-beep-reload). Drop this section for this feature disabling.
reload:
# Sync interval.
#
# Default: "1s"
interval: 1s
# Global patterns to sync.
#
# Default: [".php"]
patterns: [ ".php" ]
# List of included for sync services (this is a map, where key name is a plugin name).
#
# Default: <empty map>
services:
server:
# Directories to sync. If recursive is set to true, recursive sync will be applied only to the directories in
# "dirs" section. Dot (.) means "current working directory".
#
# Default: []
dirs: [ "." ]
# Recursive search for file patterns to add.
#
# Default: false
recursive: true
# Ignored folders.
#
# Default: []
ignore: [ "vendor" ]
# Service specific file pattens to sync.
#
# Default: []
patterns: [ ".php", ".go", ".md" ]
http:
# Directories to sync. If recursive is set to true, recursive sync will be applied only to the directories in
# "dirs" section. Dot (.) means "current working directory".
#
# Default: []
dirs: [ "." ]
# Recursive search for file patterns to add.
#
# Default: false
recursive: true
# Ignored folders.
#
# Default: []
ignore: [ "vendor" ]
# Service specific file pattens to sync.
#
# Default: []
patterns: [ ".php", ".go", ".md", ".js", ".css", ".json" ]
Actually, it runs Laravel bridged workers. Due to Laravel Nova not compatible with async (it spawns a lot of DB connections and stores some settings in static vars outside the app container), we decided to set max_jobs: 1 until problem is solved. I expected to see this happen: explanation
As for now, I receive error in browser:
1 error occurred:
* supervised_exec_with_context: Timeout: context deadline exceeded
Errortrace, Backtrace or Panictrace
gb_admin | 2021-04-01T10:25:27.127Z WARN server server/plugin.go:208 no free workers in pool {"error": "static_pool_exec_with_context: NoFreeWorkers:\n\tworker_watcher_get_free_worker: no free workers in the container, timeout exceed"}
gb_admin | github.com/spiral/roadrunner/v2/plugins/server.(*Plugin).collectEvents
gb_admin | github.com/spiral/roadrunner/v2@v2.0.1/plugins/server/plugin.go:208
gb_admin | github.com/spiral/roadrunner/v2/pkg/events.(*HandlerImpl).Push
gb_admin | github.com/spiral/roadrunner/v2@v2.0.1/pkg/events/general.go:37
gb_admin | github.com/spiral/roadrunner/v2/pkg/pool.(*StaticPool).getWorker
gb_admin | github.com/spiral/roadrunner/v2@v2.0.1/pkg/pool/static_pool.go:230
gb_admin | github.com/spiral/roadrunner/v2/pkg/pool.(*StaticPool).execWithTTL
gb_admin | github.com/spiral/roadrunner/v2@v2.0.1/pkg/pool/static_pool.go:175
gb_admin | github.com/spiral/roadrunner/v2/pkg/pool.(*supervised).Exec.func1
gb_admin | github.com/spiral/roadrunner/v2@v2.0.1/pkg/pool/supervisor_pool.go:99
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (14 by maintainers)
Commits related to this issue
- Update .rr.yaml https://github.com/spiral/roadrunner/issues/619 — committed to spiral-modules/roadrunner-binary by tarampampam 3 years ago
@48d90782 Yes, now workers constructing as needed
@tarampampam Could you please help me with the
roadrunner-laravelpackage?