Commit Graph
6011 Commits
Author SHA1 Message Date
Simon Pinfold 195045d257 docs(db): restore the rationale for locking before migration
Commit 1dbcdcd7 and the comment-cleanup pass 8205022f reduced this to "All
database reads and writes, including the legacy import, run under the lock",
dropping the part that did the work: upstream master locks after migrating and
justifies it with "Alembic uses its own connection, so we must wait until it's
done before locking -- otherwise our own lock blocks the migration". That is
false, the lock is on a separate <db>.lock file, and the surviving sentence
said nothing to stop a contributor "fixing" the ordering back.

Restored and adapted rather than pasted: the legacy copy and the db_exists
probe now happen inside the lock, which the original text predates, so both
are named in the list of things the ordering makes mutually exclusive.
2026-09-17 19:47:38 -07:00
Simon Pinfold f8b47bbcb4 refactor(assets): export the live-path conflict check as public API
scanner.py reached past the package's own re-export surface to import
_is_live_path_conflict directly out of records.py. The underscore said
module-private while the import said otherwise, and records.py deliberately
publishes its public names through app.assets.database.queries -- which the
same import block three lines above was already using.

The use is correct and unchanged; only the name and the route change. Renamed
to is_live_path_conflict, listed in the package __init__ import and __all__
alongside its siblings, and scanner.py now takes it from the package like
everything else it imports from there.
2026-09-17 19:47:38 -07:00
Simon Pinfold e9af384a9e fix(assets): keep spec construction failures from wedging the watch list
get_name_and_tags_from_asset_path raises ValueError by contract when a path
stops resolving to a configured root, and it sat outside the guard, as did
compute_loader_path and mimetypes.guess_type. An escape skipped the
_WATCH_LIST[:] = remaining write at the end, so drained entries stayed on the
list and were re-attempted every tick while entries past the fault never
reached the increment _WATCH_SCAN_RETRIES needs to retire them. The list
wedged permanently.

Spec construction is now inside a guard that drops just the offending entry,
and the list write moved into a finally so no future escape can skip it. The
loop walks an iterator rather than the list, so the finally can put back the
entries it never reached instead of discarding them.

New event name rather than reusing one: scanner.watch_seed_failed is emitted
only when seed_asset_specs returns an error, and widening it to also mean
"never got as far as seeding" would make it lie -- a consumer treating it as a
database-health signal would get false positives from what is really a path
layout problem. scanner.watch_spec_failed is registered in ALLOWED_EVENTS and
in the static call-site manifest.
2026-09-17 19:47:37 -07:00
Simon Pinfold e0286a695e fix(assets): emit the invalid-mtime event once per scan
Every other per-file emit on this scan path is gated -- mark_emitted(
"stat_failed:enrich"), "hash_discarded_modified", "hash_failed",
"enrich_failed" -- but scanner.invalid_mtime fired per file, so a restored
archive or a FAT volume of pre-epoch mtimes put one structured event per file
into the stream the closed vocabulary exists to keep parseable.

Counted and emitted once, carrying the count. seed_asset_specs receives no
_ScanProgress object and neither does insert_asset_specs above it, so routing
this through mark_emitted would mean changing both signatures plus the seeder
call site; the count form needs neither and the event is now strictly more
informative than N identical fieldless lines. The per-file logging.warning is
unchanged, and the emit stays inside seed_asset_specs so the static call-site
manifest still matches.

test_seed_skips_negative_fresh_mtime_with_warning_and_telemetry now pins the
full list of invalid_mtime lines to exactly ["... count=1"] instead of
asserting one such line exists -- a strictly stronger assertion, and the only
change the new field required.
2026-09-17 19:47:37 -07:00
Simon Pinfold 64d884aef0 refactor(assets): reap empty upload directories without importing the API layer 2026-09-17 19:47:37 -07:00
Simon Pinfold c0e5ecc1d4 fix(assets): reject duplicate file parts instead of stranding the first upload 2026-09-17 19:47:37 -07:00
Simon Pinfold d071895286 refactor(assets): collapse the duplicated batch fault deferral into seed_asset_specs 2026-09-17 19:47:37 -07:00
Simon Pinfold e9b3587ae7 fix(assets): distinguish partial batch insert failures 2026-09-17 19:47:36 -07:00
Simon Pinfold 1f34110261 fix(assets): report specs committed before a batch fault and preserve the fault itself 2026-09-17 19:47:36 -07:00
Simon Pinfold 1eac7422e5 test(db): drop the inert legacy-copy patch from the path preparation tests
prepare_file_db_path no longer copies the legacy database - that moved inside the process lock in _init_file_db - so patching copy_legacy_default_db here did nothing. Leaving it implied a side effect the function does not have, and would have masked one if it were reintroduced.
2026-09-17 19:47:36 -07:00
Simon Pinfold 80682d076a fix(assets): preserve successful specs when a scan batch fault propagates 2026-09-17 19:47:36 -07:00
Simon Pinfold d496e23bb5 fix(assets): remove temporary uploads on non-UploadError failures 2026-09-17 19:47:36 -07:00
Simon Pinfold c605a9be77 fix(assets): keep unreadable filesystem metadata from failing a whole scan batch 2026-09-17 19:47:35 -07:00
Simon Pinfold 2a89925379 chore: comment cleanup
Comment-Gate: 3 quarantined
2026-09-17 19:47:35 -07:00
Simon Pinfold e13f0e1f43 test(assets): make the keyset tie-breaker and temp-exclusion tests falsifiable 2026-09-17 19:47:35 -07:00
Simon Pinfold 68c7893381 fix(assets): correct event-log status snapshots and failure telemetry 2026-09-17 19:47:35 -07:00
Simon Pinfold a6b508bd4b docs(assets): make module docstrings and the rebuild warning truthful 2026-09-17 19:47:34 -07:00
Simon Pinfold 9b8e766edc fix(assets): keep updated_at stable on no-op renames 2026-09-17 19:47:34 -07:00
Simon Pinfold 417532d548 fix(assets): clean up temp uploads on validation failures
Multipart parsing writes the uploaded bytes to a temporary file before it
validates the remaining form fields, so a request rejected after its file
part had already been read left the temp file and its uuid directory on
disk.

Routing those removals through delete_temp_file_if_exists also changes the
success path. The previous helper returned early when the temp file was
already gone, so it never reached the parent rmdir; the shared helper
attempts the rmdir unconditionally. Moving the upload to its destination
leaves the temp path absent, so a successful upload now also discards its
empty uuid directory, closing a pre-existing leak.
2026-09-17 19:47:34 -07:00
Simon Pinfold 9c6749ab38 fix(assets): drop watch-list entries on stat errors instead of aborting the scan 2026-09-17 19:47:34 -07:00
Simon Pinfold 6bc286c0e6 fix(db): copy the legacy database inside the process lock 2026-09-17 19:47:34 -07:00
Simon Pinfold d698d2a27b fix(assets): only absorb duplicate-path races when seeding scanned assets 2026-09-17 19:47:33 -07:00
Simon Pinfold bca8ad7d57 docs(assets): name the unattempted rows instead of the ones behind the cursor
The cursor moves forward through ascending ids, so 'the rows behind it' reads as the rows already passed - the opposite of what is selected again.
2026-09-17 19:47:33 -07:00
Simon Pinfold fba73d181e test(assets): let a broken prompt worker import fail instead of skipping
The fixture wrapped importlib.import_module in a bare except that called
pytest.skip, so a circular import, a missing dependency or a syntax error in
app/prompt_worker.py would retire all four resume-contract tests while CI
stayed green. The whole premise of extracting the module is that main.py can
import it, so an import failure has to be a collection error.

The CPU guard is genuinely load-bearing — comfy.model_management selects its
device at import time and a CUDA build with no driver raises there — so it is
kept, but as a precondition rather than an exception handler, matching the
args.cpu-before-import convention already used by the comfy_test and
comfy_api_nodes_test modules. Nothing is caught now.
2026-09-17 19:47:33 -07:00
Simon Pinfold 1f30b3ab33 test(api): derive the expected assets flag from the manager under test
The assertion asked for the flag with no argument, so it read the parameter default rather than anything the manager reported - in a test whose subject is the two agreeing. Passing the manager's own state keeps it honest if the setup ever yields an enabled manager.
2026-09-17 19:47:33 -07:00
Simon Pinfold 8584704894 docs(assets): describe enrichment rows as attempted rather than selected
The cursor holds at the last row a batch actually attempted, so a pause ends a batch early and the rows behind it are selected again when the scan resumes. Only the attempt is capped at once per pass.
2026-09-17 19:47:33 -07:00
Simon Pinfold a787e251cc chore(assets): address review follow-ups in the hashing guard, feature flags, and pagination pin 2026-09-17 19:47:32 -07:00
Simon Pinfold 3af6baf6b2 fix(assets): track the scan pause across prompt worker iterations 2026-09-17 19:47:32 -07:00
Simon Pinfold e30769a9f8 fix(assets): advance the enrichment cursor only past rows the batch attempted 2026-09-17 19:47:32 -07:00
Simon Pinfold 5ce874200c refactor(assets): test the blake3 import guard in-process instead of via subprocess 2026-09-17 19:47:32 -07:00
Simon Pinfold ac1b25e02f refactor(assets): extract prompt_worker so its resume contract is testable in-process 2026-09-17 19:47:31 -07:00
Simon Pinfold 0297d729a3 fix(assets): paginate enrichment by id cursor so failures cannot starve or overflow the query 2026-09-17 19:47:31 -07:00
Simon Pinfold 9f2b470216 fix(api): derive the assets feature flag from the selected manager 2026-09-17 19:47:31 -07:00
Simon Pinfold 8fffd7da73 fix(assets): always resume background scanning when prompt handling fails 2026-09-17 19:47:31 -07:00
Simon Pinfold 560a1ffa56 fix(assets): guard the hashing dependency and chain the real import error 2026-09-17 19:47:31 -07:00
Simon Pinfold 898348bc20 refactor(tests): hoist migration-0007 test imports to module scope 2026-09-17 19:47:30 -07:00
Simon Pinfold d9d78b99da test(assets): cover asset system state index parity 2026-09-17 19:47:30 -07:00
Simon Pinfold 7eaabb5ca0 test(assets): assert alembic and ORM index parity for the surviving asset tables 2026-09-17 19:47:30 -07:00
Simon Pinfold 2e942be639 docs(assets): clarify asset schema docstring 2026-09-17 19:47:30 -07:00
Simon Pinfold 02842ce6bd fix(assets): drop asset_meta when downgrading a database that already created it 2026-09-17 19:47:30 -07:00
Simon Pinfold b9c428b6c5 chore(assets): drop the unused asset_meta table from migration 0007 2026-09-17 19:47:29 -07:00
comfyanonymous 4d7e61b7d4 Fix issue with qwen speedup PR. (#16389) 2026-09-17 21:34:05 -04:00
Jukka Seppänen 9a77c1db9e Qwen3/3.5/3.8 cudagraphs and w4a8 gemv support (CORE-390) (#15623) 2026-09-17 20:38:24 -04:00
Alexis Rolland 7de99222f0 chores: Update nodes names and categories (#16274) 2026-09-17 19:48:54 -04:00
Alexis Rolland fd88b3c412 Update default width and height in EmptyLatentImage (#16384) 2026-09-17 19:47:58 -04:00
comfyanonymous cf5cc2b698 Update comfy-kitchen version to 0.2.35 (#16385) 2026-09-17 19:12:53 -04:00
Jukka Seppänen a2f455c9da feat: Support MoGe 3 (CORE-443) (#16381) 2026-09-17 14:17:04 -04:00
Alexander Piskun 387f98aa28 [Partner Nodes] fix(Tripo): refuse a P2 run whose linked GLB or FBX output would be empty (#16369)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-09-17 11:29:13 +04:00
comfyanonymous d39cdfdb03 Always put text encoder on GPU when dynamic vram on. (#16374) 2026-09-16 22:27:39 -04:00
comfyanonymous 4e779e5619 Add CFG control to YuE2 Generate Music node (#16373) 2026-09-16 21:38:29 -04:00