Thanks James.
Here are links for further reading for anyone watching. Looks like the
proxy may be removed imminently with any luck.
https://github.com/docker/docker/issues/8356
https://github.com/docker/docker/pull/9078
However there is some chance it may hang around to support some
non-linux systems.
Sadly, the userland proxy is less magical than I thought it might be,
as you said:
https://github.com/docker/docker/blob/master/pkg/proxy/tcp_proxy.go
What should a TCP proxy do when upstream is unavailable?
Is there any way in theory a TCP proxy can signal to a connectee that
upstream is unavailable? Ultimately when the initiator connects and
upstream is not alive, I would like the initator's read or write
syscalls to fail with error.
I can think of a few partial solutions which all have drawbacks.
1. Make the upstream connection in advance of accepting
Drawbacks:
* Results in idle connection to upstream for an arbitrarily long time
* If upstream doesn't accept, the proxy doesn't accept and the
inbound client blocks
2. If it's not possible to connect to upstream, send an out-of-band
exception packet
Drawbacks:
* Requires the initiator to be aware of this protocol extension
3. Send a garbage packet and hope that this causes the initiator to
fail with errors.
Drawbacks:
* Eww. (Even more than the other ideas)
If there is no workable solution, ultimately it looks like I will have
to live with being somewhat protocol-aware or have to have a way of
negotiating with the target listener that they are ready to receive
connections, which seems unfortunate.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.