-
Notifications
You must be signed in to change notification settings - Fork 712
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
Pipes #650
Conversation
bd4df51
to
cb07d8f
Compare
@@ -20,6 +22,35 @@ type Response struct { | |||
ID int64 | |||
Value interface{} | |||
Error string | |||
Pipe int64 |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I'll put all the feedback in one comment for now:
In general I'm not super-keen on the windows-within-windows approach, maybe you should put this in front of @pidster, @rade and @monadic to see what they think? Also we need to nail down the lifecycle of these things. I'm thinking:
What do you think? (@paul would be good to get your input too) |
Also, if you stop scope underneath the UI, it resized an open terminal very small. If you put try to reconnect (maybe with a 'reconectting...' overlay on the terminal) with a backoff, and if you get an error code (404, as opposed to bad hostname or can't connect) it should show an error ("this pipe has gone away. Sooooory") Another thing: click-and-drag doesn't move the window to the foreground - need to move it to foreground on mouse down I think. Another thing: click-and-drag doesn't move the window to the foreground - need to move it to foreground on mouse down I think. |
Comprehensive feedback! |
I've talked to @pidster, @bboreham, @awh, @dpw, @monadic and @rade about the window-manger-in-a-browser-window 'feature' for feedback, which summarized was:
This way, if the user wants to have multiple terminals (or topology view) side-by-side, they have to use their own windows manager and separate scope tabs/windows. Everyone I spoke to (except @monadic) preferred this idea. Note it doesn't involved us implementing a window manager ourselves, and fits nicely with the 'window management' of the details panel. |
re: lifecycle I'm not sure about having a buffer overflow teardown the pipe. Some sort of pipe-specific backpressure would be better, but not sure on the feasibility of implementing that in probe/UI. I'd rather have some sort of timeout/teardown for unused pipes, with not connections open. Even if they're not active. It's just bad form to leave them around. Doesn't have to be aggressive, something on the order of an hour without usage would be fine. Other than that, sounds roughly sane. |
} | ||
go p.loop(w) | ||
return p | ||
} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
After discussion with @paul, I've been convinced the previous pipe-lifecycle design was floored and we need to introduce some for of back pressure to ensure
This brings us on to the pipe lifecycle. Again, @paul convinced me we need to timeout pipes that are unused. This need to deal with App and Probe restarts (not leaking resources in either), but also long lived idle pipes - we want pipes to stay open when you go home for the night, for instance.
This should deal nicely with app restarts (pipes will eventually get reconnected) and probe restarts (pipes will timeout in the app). |
This seems incredibly odd to me. Pipes are a quick-and-easy way to get at specific parts of your infrastructure, ephemeral and not long-lived. Similarly,
I'd rather expect the moment a user closes the UI element that spawned the pipe, the pipe should be torn down. — edit Timeouts are still necessary, in case the teardown signal doesn't make it from the UI to the app for whatever reason.
This seems like a huge can of worms, better left unopened. If a pipe connection fails, tear it down cleanly on all sides, and wait for the user to re-initiate a new connection via the UI. Scope isn't a terminal emulator... |
Yes we'll add this as well, using the same mechanism for timeouts. Sorry that wasn't clear. |
Just did the demo with @squaremo and he had the suggestion that ctrl-click on the attach button should open in new window. Otherwise I think he was 50/50 between option (3) & (4). |
I think
so that leads me to suggest that the info pane is attached to the side of the window, and the console is attached to that. EDIT: link to MDI |
What happens if we fail to send the DELETE /api/pipe/:pid in some cases? (E.g. user quitting the browser). Time's out after a few minutes and no harm done? |
Or, user hitting the back button... |
Yes, we'll timeout the pipes after 10mins or so. I think that was in the design. |
Came across a nifty API in chrome/firefox (and can be reasonably polyfilled elsewhere) for sending fire-and-forget requests as the browser is unloading the page: It has a very simple api:
|
I'd suggest Edit: For no particular reason, other than it matches rails. |
+1 Good call much nicer. |
log.Printf("Timeing out pipe %s", id) | ||
delete(pr.lastPut, id) | ||
pipe := pr.pipes[id] | ||
pipe.Close(now) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
2nd round of UI feedback (popouts and resizing work now) (10) action to close should be all caps, no underline (and maybe a different color), like the ones in the topo options. (11) popout window has url bar, which suggests that it's sharable, which does not seem to work (12) chrome v45 crashes when doing 2 popouts in a row (will create separate issue):
|
if (wereConnected) { | ||
this.createWebsocket(term); | ||
} else { | ||
reconnectTimer = setTimeout( |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Can't get rid of url bar these days. =/
Couldn't figure this out! =/ But the rest of it should be working! |
in case we ever have 2 terminals
UI and JS LGTM |
I've opened #746 to deal with ncurses/popout/resize issues. |
Ok, have opened issues for remaining issues. So all LGTM. |
…ng from AppClient.Close()
Fixes #365, Fixes #648
UI Todo:
ESC
gracefully when not-popped out.Handle presses of other buttons? (Close on pause or restart?).Backend Todo: