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

Ctrl-C signal not handled if labels not found on forwards #17

Open
mcadam opened this issue Aug 28, 2019 · 2 comments

Comments

@mcadam
Copy link

commented Aug 28, 2019

Hi,

Another issue that's kind of allowing I noticed, might as well raise it, should be easy to fix. If I start some forwards and the namespace does not contain the deployment with the labels specified, then it's going to hang forever, and no feedback at all from the program just blank screen. It would be nice to first have some feedback whats it trying to do, here find the deployment with those labels, maybe even print the labels its looking for, so we might realise we made an error or wrong namespace.
And at this point monday already is catching signal Ctrl-C so we can't kill the program at this point from that shell. We need to open a new shell and kill the process manually. And then the other shell is in a bad state cause the program was also trying to redirect stdout stderr I am guessing. It's not closed "properly".

If you have sometime to work on that at some point, I wouldn't say its high priority but a nice to have.

Thanks for the tool again.

Steps for Reproduction*

  1. Set up a kubernetes-remote forward in the config.yaml configuration file with labels not available in the namespace specified or a wrong namespace
  2. Start Monday
  3. Blank screen
  4. Hit Ctrl-C to kill the program

Expected behavior:

The program is closed properly.

Actual behavior:

Nothing happens, manually killing the process then put that shell in a "bad" state.

Platforms:

Linux Ubuntu 18.04 / Mac OS

Versions:

Monday 1.0.4

@eko

This comment has been minimized.

Copy link
Owner

commented Sep 14, 2019

Hi @mcadam,

Thank you for reporting this issue, I will try to repoduce in the coming days and will let you know about it. It's great that you have identified a start of the issue :)

@eko

This comment has been minimized.

Copy link
Owner

commented Oct 5, 2019

Hi @mcadam,

Maybe this has been fixed since the 1.0.4 version but here is what I tried to do to reproduce this issue (I've tested with v1.0.8).

I added the following configuration:

# A non-existant label match on Kubernetes
<: &unknown-service-kubernetes
  name: unknown-service
  type: kubernetes
  values:
    context: *kubernetes-context
    namespace: platform
    hostname: unknown.svc.local
    labels:
      app: this-is-totally-unknown-from-kubernetes
    ports:
     - 8080:8080

# A project with this non-existant forward
projects:
 - name: Unknown service (forward)
   forward:
    - *unknown-service-kubernetes

Then, when I run Monday and select this project, I have the following output and when I hit "Ctrl+C", it's OK:

$ monday
✔ Unknown service (forward)

📡  Forwarding 'unknown-service' over kubernetes...
✅  Successfully mapped hostname 'unknown.svc.local' with IP '127.1.2.1' and port 9401
🔌  Proxifying unknown.svc.local locally (127.1.2.1:8080) <-> forwarding to 127.0.0.1:9401
No pod available for selector 'app=this-is-totally-unknown-from-kubernetes': <nil>
👓  Forwarder: lost port-forward connection trying to reconnect...
No pod available for selector 'app=this-is-totally-unknown-from-kubernetes': <nil>
👓  Forwarder: lost port-forward connection trying to reconnect...
No pod available for selector 'app=this-is-totally-unknown-from-kubernetes': <nil>
👓  Forwarder: lost port-forward connection trying to reconnect...
^C
👋  Bye, closing your local applications and remote connections now

I've also tried using the UI with --ui and it's also correctly interrupted

Could you please close this issue if it's fixed for you too?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.