Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run COMMAND PROCESS blocks for ever #33

Open
nikandfor opened this issue Feb 27, 2017 · 6 comments
Open

run COMMAND PROCESS blocks for ever #33

nikandfor opened this issue Feb 27, 2017 · 6 comments

Comments

@nikandfor
Copy link

$ 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
Copy link
Owner

mattn commented Feb 27, 2017

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

@nikandfor
Copy link
Author

$ 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
Copy link
Owner

mattn commented Feb 28, 2017

RPC wait terminating of processes for 10 seconds if available.

goreman/proc.go

Lines 34 to 40 in 7e31d82

timeout := time.AfterFunc(10*time.Second, func() {
p.mu.Lock()
defer p.mu.Unlock()
if p, ok := procs[proc]; ok && p.cmd != nil {
err = p.cmd.Process.Kill()
}
})

Do you wait over 10 seconds?

@nikandfor
Copy link
Author

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
Copy link
Owner

mattn commented Feb 28, 2017

The command pbin accept to stop with CTRL-C?

@nikandfor
Copy link
Author

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$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants