Skip to content

fix(sqlite): disable incomplete preload hint flush#4895

Draft
NathanFlurry wants to merge 1 commit intographite-base/4895from
driver-test-complaints/stub-preload-hints
Draft

fix(sqlite): disable incomplete preload hint flush#4895
NathanFlurry wants to merge 1 commit intographite-base/4895from
driver-test-complaints/stub-preload-hints

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 3, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 3, 2026

Code Review: fix(sqlite): disable incomplete preload hint flush

Overview

This PR disables the SQLite preload hint flush feature by gutting the implementations of enqueue_preload_hint_flush_best_effort and flush_preload_hints_best_effort, making metrics() always return None, and removing the now-unused snapshot_preload_hints, protocol_preload_hints, VfsPreloadHintSnapshot import, and timeout import. The stated reason is that depot_client does not yet expose a stable NativeDatabaseHandle::sqlite_vfs_metrics surface.

This is a legitimate "disable while unblocked" approach. The changes are safe and remove ~150 lines of code that could not work anyway. A few things worth addressing before this lands:


Issues

1. Background task still spawns and ticks every 30 s when the flag is enabled

ensure_preload_hint_flush_task (line 367) guards on sqlite_optimization_flags().preload_hint_flush. If that flag is off the task is never spawned. But if it is on, a tokio::spawn fires every PRELOAD_HINT_FLUSH_INTERVAL to call an empty function. Consider making ensure_preload_hint_flush_task return early unconditionally until the feature is ready, so the flag cannot accidentally spin up a no-op timer.

2. PRELOAD_HINT_FLUSH_INTERVAL drives a no-op loop

The constant is still referenced in the active interval loop, so it is not dead code in the compiler sense, but it semantically controls nothing. A reader who sees the constant and the loop without noticing the empty called functions will be confused. A short inline comment on the constant noting it is disabled would help.

3. Empty stub functions with _-prefixed parameters is an unusual pattern

Underscored parameters are typically used to silence warnings inside a real body, not to mark a placeholder. Two cleaner options: (a) remove the stub functions entirely and comment out their call sites, or (b) add a one-line comment inside each body such as // Disabled: waiting for depot-client stable surface.

4. No deferred work item tracked

The comment on metrics() explains why it is disabled, but per project convention deferred work should have an entry in .agent/todo/. A small file noting what needs to happen in depot_client before this can be re-enabled would make the follow-up findable.


What is Good

  • Import cleanup (timeout, VfsPreloadHintSnapshot) is correct and tight.
  • PRELOAD_HINT_FLUSH_TIMEOUT constant was cleanly removed since it is no longer used.
  • The explanatory comment on metrics() is appreciated over a silent None.
  • Helper functions snapshot_preload_hints and protocol_preload_hints were fully deleted rather than left as dead code.

@NathanFlurry NathanFlurry force-pushed the driver-test-complaints/fix-vfs-register-block-on branch from 215bb00 to c237935 Compare May 3, 2026 07:34
@NathanFlurry NathanFlurry force-pushed the driver-test-complaints/stub-preload-hints branch from afafe22 to 7cff899 Compare May 3, 2026 07:34
@NathanFlurry NathanFlurry changed the base branch from driver-test-complaints/fix-vfs-register-block-on to graphite-base/4895 May 3, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant