mattn / goreman

foreman clone written in go language
MIT License
2.48k stars 195 forks source link

run COMMAND PROCESS blocks for ever #33

Open nikandfor opened 7 years ago

nikandfor commented 7 years ago
$ goreman -f Procfile_db run stop p1
# <- blocks here
^C
$ goreman -f Procfile_db run stop p1
no such process

and nothing is going on at my terminale window where I run

$ goreman -f Procfile_db start
19:53:23 p1 | Starting p1 on port 5000
19:53:23 p3 | Starting p3 on port 5002
19:53:23 p2 | Starting p2 on port 5001
19:53:23 p2 | I0227 19:53:23.450337   27167 main.go:88] ...
19:53:23 p2 | I0227 19:53:23.450390   27167 main.go:101] ...
19:53:23 p1 | I0227 19:53:23.450827   27166 main.go:88] ...
19:53:23 p1 | I0227 19:53:23.450872   27166 main.go:101] ...
19:53:23 p3 | I0227 19:53:23.450982   27171 main.go:88] ...

system: ubuntu 16.10

$ uname -a:
inux nik-msi 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ go version
go version go1.8rc3 linux/amd64
mattn commented 7 years ago

Could you please show me your Procfile_db and .env if you have.

nikandfor commented 7 years ago
$ cat Procfile_db
p1: pbin -logtostderr -http :6060 -addr :31337 -db "failover" -join :31337 --nodeid 0
p2: pbin -logtostderr -http :6061 -addr :31338 -db "failover" -join :31337 --nodeid 55
p3: pbin -logtostderr -http :6062 -addr :31339 -db "failover" -join :31337 --nodeid b
$ cat .env
DBPATH=/tmp/ram/test
mattn commented 7 years ago

RPC wait terminating of processes for 10 seconds if available.

https://github.com/mattn/goreman/blob/7e31d82aa8a4e8702649a2ae0530246905818661/proc.go#L34-L40

Do you wait over 10 seconds?

nikandfor commented 7 years ago
nik@nik-msi@03:23:45:pdir$ goreman run stop p1
^C 
nik@nik-msi@03:25:42:pdir$

Yes, I've waited for minute and more

mattn commented 7 years ago

The command pbin accept to stop with CTRL-C?

nikandfor commented 7 years ago

yes, it does after ^C of goreman run ... it can't find process. like this:

nik@nik-msi@04:41:32:pdir$ goreman -f Procfile_db run stop p1
^C
nik@nik-msi@04:41:35:pdir$ goreman -f Procfile_db run stop p1
no such process
nik@nik-msi@04:41:36:pdir$ 

stopping goreman at first terminal works fine:

04:41:17 p1 | I0228 04:41:17.746522   28478 db3.go:316] 0 records imported in 337.173µs
04:41:17 p2 | I0228 04:41:17.748102   28482 db3.go:316] 0 records imported in 1.12864ms
^C04:43:20 p1 | I0228 04:43:20.901651   28478 main.go:285] graceful quit
04:43:20 p1 | 2017/02/28 04:43:20 transport: http2Server.HandleStreams failed to read frame: read tcp 127.0.0.1:31337->127.0.0.1:44706: use of closed network connection
04:43:20 p3 | 2017/02/28 04:43:20 transport: http2Server.HandleStreams failed to read frame: read tcp 127.0.0.1:31339->127.0.0.1:56084: use of closed network connection
04:43:20 p3 | 2017/02/28 04:43:20 transport: http2Server.HandleStreams failed to read frame: read tcp 127.0.0.1:31339->127.0.0.1:56076: use of closed network connection
04:43:20 p3 | 2017/02/28 04:43:20 transport: http2Server.HandleStreams failed to read frame: read tcp 127.0.0.1:31339->127.0.0.1:56070: use of closed network connection
04:43:20 p3 | I0228 04:43:20.901643   28480 main.go:285] graceful quit
04:43:20 p2 | I0228 04:43:20.901653   28482 main.go:285] graceful quit
04:43:20 p2 | 2017/02/28 04:43:20 transport: http2Server.HandleStreams failed to read frame: read tcp 127.0.0.1:31338->127.0.0.1:51464: use of closed network connection
04:43:20 p2 | Terminating p2
04:43:20 p1 | Terminating p1
04:43:20 p3 | Terminating p3
nik@nik-msi@04:43:20:pdir$