Files
podman/cmd/podman
W. Trevor King c82166afab cmd/podman/utils.go: Cancel-able resize writes
On Thu, Jun 28, 2018 at 03:48:26AM -0700, Marco Vedovati wrote [1]:
> The root cause is a deadlock between two channel writes made by two
> different goroutines:
>
> 1. `resizeTty() : go func(){} : sendUpdate()` is sending a resize
>    message thru `resize` right at the beginning, but the channel is
>    never read if some startup error occurs.
>
> 2. Upon program termination, `startAttachCtr() : defer func(){} ` is
>    telling the goroutine in "1." to stop via the `resizeTerminate`
>    channel. But that guy is still waiting for the write to `resize`
>    to complete so the the termination message is never read.
>
> I think the go deadlock detection does not kick in because not all
> goroutines are seen as asleep. E.g. `os/signal Notify()` is enough
> to have the deadlock not detected.

333ab8c2 (Fix podman hangs when detecting startup error in container
attached mode, 2018-06-27, #1010) addressed this with a deferred
drain.  This commit adjusts that approach to use a single select to
cover "have we been canceled?", "has there been a resize signal?", and
(when we have one) "can we write the most recent resize event to the
resize channel?".

A side benefit to this approach is that if we have a slow resize
consumer and several resize signals, the resizeTty function will keep
updating its local resizeEvent.  Once the resize channel is able to
accept, only the most-recent event will be written.  Previously we'd
have written one resize event for every received signal, even if the
resize consumer was falling behind.

[1]: https://github.com/projectatomic/libpod/pull/1010#issuecomment-400994436

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #1018
Approved by: rhatdan
2018-06-28 15:53:02 +00:00
..
2018-06-19 14:45:29 +00:00
2018-06-05 19:31:13 +00:00
2018-04-26 19:14:44 +00:00
2018-06-12 00:47:56 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-06-19 14:45:29 +00:00
2018-06-12 00:47:56 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-03-16 14:35:07 +00:00
2018-05-02 16:55:31 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-05-21 19:26:56 +00:00
2018-04-26 19:14:44 +00:00
2018-05-10 08:53:28 +00:00
2018-06-26 09:46:29 +00:00
2018-05-11 15:32:27 +00:00
2018-06-22 19:26:46 +00:00
2018-05-03 17:31:33 +00:00
2018-06-04 18:36:40 +00:00
2018-06-13 14:30:45 +00:00
2018-05-25 08:45:15 +00:00
2018-06-27 09:46:50 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-06-18 12:56:44 +00:00
2018-04-26 19:14:44 +00:00
2018-04-26 19:14:44 +00:00
2018-06-24 10:54:40 +00:00
2018-04-23 14:29:45 +00:00
2018-04-26 19:14:44 +00:00

podman - Simple debugging tool for pods and images

podman is a daemonless container runtime for managing containers, pods, and container images. It is intended as a counterpart to CRI-O, to provide low-level debugging not available through the CRI interface used by Kubernetes. It can also act as a container runtime independent of CRI-O, creating and managing its own set of containers.

Use cases

  1. Create containers
  2. Start, stop, signal, attach to, and inspect existing containers
  3. Run new commands in existing containers
  4. Push and pull images
  5. List and inspect existing images
  6. Create new images by committing changes within a container
  7. Create pods
  8. Start, stop, signal, and inspect existing pods
  9. Populate pods with containers