You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ExecResult type returned from ContainerAsync::exec does not seem to represent a the command being completed, instead it returns before the executed command completes.
I would assume I can use ExecResult::exit_code().await to wait for the command to fully run and get the exit code, but instead it returns an Option::None when the command has not completed.
One workaround I found is to call ExecResult::stdout_to_vec().await and ExecResult::stderr_to_vec().await to stream the outputs until completion before calling ExecResult::exit_code().await. However this is far from ideal, as I need to await both these streams in order to be sure the command has completed. It would be nice if there's a ExecResult::wait().await method, or the ExecResult::exit_code().await command waits before returning the code.
The text was updated successfully, but these errors were encountered:
I guess it's worth to add mention of with_cmd_ready_condition as part of ExecResult documentation 🤔
But the interface is expected, since sometimes it's necessary to spawn some background command without waiting for its results. Or in case you want to have some custom logic which periodically checks the status of the command.
Ah no I actually completely missed the ready condition for commands 🤦🏿 my mistake.
I see CmdWaitFor::exit_code, which is probably what I want. Though it seems like there's not really any wait for condition for waiting for the command to execute completely no matter the exit code?
Yes, you're right. It will wait for particular exit code and will return an error if actual one doesn't match with expected (ExecError::ExitCodeMismatch).
We can consider shortcut "WaitCmdFor::Finish" which will ignore the code. However even right now it should be possible by handling the error returned
The
ExecResult
type returned fromContainerAsync::exec
does not seem to represent a the command being completed, instead it returns before the executed command completes.I would assume I can use
ExecResult::exit_code().await
to wait for the command to fully run and get the exit code, but instead it returns anOption::None
when the command has not completed.One workaround I found is to call
ExecResult::stdout_to_vec().await
andExecResult::stderr_to_vec().await
to stream the outputs until completion before callingExecResult::exit_code().await
. However this is far from ideal, as I need to await both these streams in order to be sure the command has completed. It would be nice if there's aExecResult::wait().await
method, or theExecResult::exit_code().await
command waits before returning the code.The text was updated successfully, but these errors were encountered: