Skip to content

Commit

Permalink
avoid hanging containers if an exception is thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
skyrpex committed Mar 14, 2024
1 parent 9c7169f commit fcd49f8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions containers/workload.sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ pub class Workload_sim {

log("containerName={name}");

return () => {
container.kill();
};
});
std.Node.of(s).hidden = true;

let s2 = new cloud.Service(inflight () => {
let name = this.state.get(this.containerIdKey).asStr();
let opts = this.props;
let var out: Json? = nil;
util.waitUntil(inflight () => {
try {
Expand Down Expand Up @@ -150,14 +159,9 @@ pub class Workload_sim {
}, interval: 0.1s);
}
}
}) as "Port Retrieval";
std.Node.of(s2).hidden = true;

log("container ready");
return () => {
container.kill();
};
});

std.Node.of(s).hidden = true;
std.Node.of(this.state).hidden = true;
}
}

0 comments on commit fcd49f8

Please sign in to comment.