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
fix(migration): Capture stderr from psql to prevent silent failures
The previous implementation used `Stdio::inherit` for the psql process, which meant that stderr was not captured by the application. This could cause the replication to appear to hang if psql encountered an error or printed a notice, as the application had no way of knowing the process had terminated or was waiting.
This change refactors the `restore_globals` function to use `tokio::process::Command` to asynchronously execute psql and capture its stdout and stderr.
- If psql exits with an error, the contents of stderr are now logged, providing clear feedback on the cause of the failure.
- Non-fatal notices (e.g., "role already exists") are treated as warnings, and the process continues.
This ensures that the application no longer hangs silently and provides better diagnostic information to the user.
0 commit comments