Skip to content

🐞 Drained engine loses entire local cache on restart: CurrentModule cannot be persisted #15082

Open

Description

@lukas-mertens

What is the issue?

What happened?

A graceful restart of a fully drained v0.21.11 engine failed to persist a cached CurrentModule object. The next startup treated the persistence store as unclean and reset both the worker cache and DagQL persistence state.

The cache contained approximately 123,000 DagQL entries and 1.5 TB of data. The engine then remained unavailable while deleting the old cache.

Environment

  • Engine: registry.dagger.io/engine:v0.21.11
  • Self-hosted Docker engine, Linux amd64
  • Kernel: 6.6.160; filesystem: XFS
  • Persistent bind mount at /var/lib/dagger
  • Docker stop timeout: 330 seconds
  • systemd stop timeout: 360 seconds

Observed sequence

  1. Paused new CI runner creation and waited for existing jobs to finish.
  2. Confirmed dagger-session-count=0 and no busy or idle runners in either Dagger tier.
  3. Restarted the engine during a Docker daemon update from 29.9.1 to 29.9.2.
  4. Cache persistence failed approximately five seconds after the cache-close phase began.
  5. Docker and the engine systemd unit reported successful deactivation; no stop-timeout or SIGKILL was reported.
  6. The new engine discarded its cache.

Relevant logs:

09:16:27 engine metrics ... dagger-session-count=0 dagql-cache-size=123463

09:18:26 starting dagql cache close hasSQLDB=true hasPersistDB=true
09:18:31 failed to persist dagql cache during close
  err="persist result 3657146 envelope: encode persisted object payload:
       type \"CurrentModule\" does not implement persisted object encoding"
09:18:31 dagql cache close exiting with error
09:18:31 failed to close base dagql cache

09:20:02 dagql persistence store marked unclean; wiping and cold-starting
  cleanShutdown=0
09:20:02 local cache state invalid; resetting worker and dagql persistence state
  reason=dagql_unclean_shutdown

Expected behavior

An orderly, drained restart should preserve valid cached results. An unsupported object should either be excluded from persistence or handled without invalidating the entire cache.

Related

Dagger version

registry.dagger.io/engine:v0.21.11

Steps to reproduce

No response

Log output

No response

Activity

  1. snoby commented on Nov 5, 2026

    @snoby

    I'm looking at caching support and came across this reported issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions