Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/commands/db/restore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ async function runRestore(
const child = spawnWpCli(composePath, ['wp', 'db', 'import', '-']);
const stderrChunks: Buffer[] = [];
child.stderr.on('data', (c: Buffer) => stderrChunks.push(c));
// Drain stdout. We don't use its content (errors come from stderr), but if
// the child writes more than the OS pipe buffer (~64KB) and nothing reads
// it, the child blocks on write and the import deadlocks.
child.stdout.resume();
const src = storage.openRead(record).pipe(createGunzip());
src.pipe(child.stdin);
await new Promise<void>((resolve, reject) => {
Expand Down
Loading