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

Tequilapi "/stop" endpoint does not stop myst service #443

Closed
Waldz opened this issue Oct 14, 2018 · 2 comments
Closed

Tequilapi "/stop" endpoint does not stop myst service #443

Waldz opened this issue Oct 14, 2018 · 2 comments
Assignees
Labels

Comments

@Waldz
Copy link
Member

Waldz commented Oct 14, 2018

How to reproduce:

  1. Start service
bin/build && bin/run service --agreed-terms-and-conditions
  1. Try to stop service thru Tequilapi
curl -X POST http://localhost:4050/stop

2018-10-14T11:53:15.974989 [Info] Application stop requested
2018-10-14T11:53:15.975132 [Info] [discovery] stopping discovery loop..
2018-10-14T11:53:15.975173 [Info] [discovery] cancelled identity registration
2018-10-14T11:53:15.975235 [Info] [service-manager] Waiting for service to finish
2018-10-14T11:53:15.986791 [Info] [nat] NAT rules cleared
2018-10-14T11:53:15.994995 [Info] [nat] IP forwarding disabled
2018-10-14T11:53:15.995061 [Info] [client-management] Shutdown
2018-10-14T11:53:15.995242 [Info] [client-management] Shutdown finished
2018-10-14T11:53:15.995282 [Info] No active connection - proceeding
2018-10-14T11:53:15.995419 [Trace] [openvpn-process] Stdout: Sun Oct 14 14:53:15 2018 event_wait : Interrupted system call (code=4)
2018-10-14T11:53:15.995481 [Info] Api stopped
Good bye
  1. Result1 (random): Process does not stop and After 3s or some time service outputs again
2018-10-14T11:53:18.001838 [Trace] [openvpn-process] Stdout: Sun Oct 14 14:53:18 2018 Closing TUN/TAP interface
2018-10-14T11:53:18.003133 [Debug] [client-management] Line received: >STATE:1539517998,EXITING,SIGINT,,,,,
2018-10-14T11:53:18.003184 [Warn] [client-management] Connection failed to read. EOF
2018-10-14T11:53:18.003212 [Trace] [client-management] Line delivering: >STATE:1539517998,EXITING,SIGINT,,,,,
2018-10-14T11:53:18.003374 [Info] [client-management] Event consumer is done
2018-10-14T11:53:18.003431 [Info] [service-openvpn] Openvpn service exited
2018-10-14T11:53:18.003527 [Warn] [client-management] Middleware stop error. connection is gone
2018-10-14T11:53:18.003653 [Trace] [openvpn-process] Stdout: Sun Oct 14 14:53:18 2018 SIGINT[hard,] received, process exiting
2018-10-14T11:53:18.003667 [Trace] [openvpn-process] Stdout: Sun Oct 14 14:53:18 2018 MANAGEMENT: >STATE:1539517998,EXITING,SIGINT,,,,,
2018-10-14T11:53:18.005274 [Info] [openvpn-process] Stderr: stream ended
2018-10-14T11:53:18.005322 [Info] [openvpn-process] Stdout: stream ended
  1. Result2 (random): Process exists:
2018-10-14T11:52:46.419441 [Info] Application stop requested
2018-10-14T11:52:46.433123 [Info] [nat] NAT rules cleared
2018-10-14T11:52:46.441483 [Info] [nat] IP forwarding disabled
2018-10-14T11:52:46.441541 [Info] No active connection - proceeding
2018-10-14T11:52:46.441692 [Info] Api stopped
Good bye
2018-10-14T11:52:46.44769 [Info] [nat] NAT rules cleared
2018-10-14T11:52:46.447734 [Warn] Failed to disable IP forwarding: [/usr/sbin/sysctl -w net.inet.ip.forwarding=0] Returned exit error: exec: Stdout already set Cmd output:
2018-10-14T11:52:46.447789 [Info] [nat] IP forwarding disabled
2018-10-14T11:52:46.447922 [Info] No active connection - proceeding
2018-10-14T11:52:46.447985 [Info] Api stopped

Expected result:

  • Result2 should be stable, not random
  • Result2 should have only 1 log message "Api stopped"
@Waldz Waldz added the bug label Oct 14, 2018
@Waldz
Copy link
Member Author

Waldz commented Oct 14, 2018

Absolutely same random stop happens with sending sig term signal(Command+C)

@tcharding
Copy link
Contributor

tcharding commented Oct 18, 2018

I can't reproduce this using curl. I ran the localnet and started the myst service as described above. curling localhost:4050/stop stopped the service 10 out of 10 times. However for meCtl-C also hangs sometimes as above.

@soffokl soffokl self-assigned this Oct 19, 2018
@Waldz Waldz added this to the Keliukis (0.5) milestone Oct 24, 2018
soffokl added a commit that referenced this issue Oct 25, 2018
* Fixed stopping of service, daemon and CLI. #443

* Bigger buffered error channels for subcommands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants