Skip to content

Commit

Permalink
Ignore irrelevant container events
Browse files Browse the repository at this point in the history
These are internal transient states which don't need to reflect in the
UI. They happen quickly in bursts, with a "permanent state" event
following such as "create", "died", or "remove".

This helps to reduce the API calls and thus mitigates out-of-order
results; see containers/podman#19124

We are not really interested in `podman exec` events, so
we would like to ignore `exec_died` along with `exec`. However, it is
the only thing that saves us from inconsistent `health_state` events
(see containers/podman#19237). So we cannot
rely on the latter event, but instead have to do a full update after
each `exec_died`, as some of them are the health checks.

Also fix the alphabetical sorting of the remaining events.
  • Loading branch information
martinpitt committed Jul 14, 2023
1 parent 894a427 commit 92398c3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ class Application extends React.Component {
case 'export':
case 'import':
case 'init':
case 'health_status': // HACK: broken, https://github.com/containers/podman/issues/19237; see exec_died
case 'kill':
case 'mount':
case 'prune':
case 'restart':
case 'sync':
case 'unmount':
case 'wait':
break;
/* The following events need only to update the Container list
Expand All @@ -349,19 +356,13 @@ class Application extends React.Component {
).then(() => this.updateContainer(id, system, event));
break;
case 'checkpoint':
case 'cleanup':
case 'create':
case 'died':
case 'exec_died':
case 'kill':
case 'cleanup':
case 'mount':
case 'exec_died': // HACK: pick up health check runs, see https://github.com/containers/podman/issues/19237
case 'pause':
case 'prune':
case 'restart':
case 'restore':
case 'stop':
case 'sync':
case 'unmount':
case 'unpause':
case 'rename': // rename event is available starting podman v4.1; until then the container does not get refreshed after renaming
this.updateContainer(id, system, event);
Expand Down

0 comments on commit 92398c3

Please sign in to comment.