Skip to content

fix: exports failing intermittently due to tmp directory errors - #9658

Merged
k-anshul merged 2 commits into
mainfrom
backup_fix
Jul 7, 2026
Merged

fix: exports failing intermittently due to tmp directory errors#9658
k-anshul merged 2 commits into
mainfrom
backup_fix

Conversation

@k-anshul

@k-anshul k-anshul commented Jul 7, 2026

Copy link
Copy Markdown
Member

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@k-anshul k-anshul self-assigned this Jul 7, 2026
@k-anshul
k-anshul requested review from begelundmuller and pjain1 July 7, 2026 07:18
Comment thread runtime/drivers/sqlite/backups.go Outdated

// Direct DuckDB's temp directory to our controlled tmpDir.
// By default, in-memory DuckDB creates ".tmp" in the current working directory, which may not be writable.
duckdbTmpDir, err := c.storage.RandomTempDir("duckdb-tmp")

@pjain1 pjain1 Jul 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a sub directory inside tmpDir itself? Also if its a separate dir then lets defer os.RemoveAll(duckdbTmpDir) before defer duckdb.Close() so that first duckdb is closed first and then dir is removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a sub directory inside tmpDir itself?

It can be but felt better to isolate from sqlite db file which can also generate its own journal files/tmp files.

Also if its a separate dir then lets defer os.RemoveAll(duckdbTmpDir) before defer duckdb.Close() so that first duckdb is closed first and then dir is removed.

Sure.

@k-anshul
k-anshul merged commit ff5571c into main Jul 7, 2026
10 checks passed
@k-anshul
k-anshul deleted the backup_fix branch July 7, 2026 13:46
k-anshul added a commit that referenced this pull request Jul 7, 2026
* fix: exports failing intermittently due to tmp directory errors

* review comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants