Honour `config_from_object(silent=True)` on the lazy config load (#10532)
* Honour config_from_object(silent=True) on the lazy config load
config_from_object() records the source and defers the import until the
configuration is first read. The silent flag was applied only on the
eager path, so it was lost by the time _load_config() imported the
module, and a missing module raised ModuleNotFoundError from the first
attribute access instead of being ignored.
The docstring states that import errors will be ignored when silent is
true, with no carve-out for the lazy path.
The flag is now remembered alongside the source and passed through to
the loader, which already handles it correctly.
Fixes #4603
* Carry the silent flag through pickling
An app pickled after config_from_object(silent=True) but before its
configuration was first read reached the child process unconfigured, so
the child performed the import itself, without the flag, and raised.
__reduce_keys__ now includes it and __init__ accepts it, matching how
config_source is already carried.
* Carry the silent flag through the deprecated v1 reduction too
Celery.__reduce__() still routes through __reduce_v1__() for any subclass
that defines its own __reduce_args__(), so carrying the flag only in
__reduce_keys__() left that path losing it.
config_source_silent is appended after config_source in __reduce_args__
and in AppPickler.build_standard_kwargs(), where it is a trailing
optional argument, so a shorter payload written by an older Celery still
loads and simply defaults the flag off.
---------
Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com> A
Arockia Rajamanickam committed
2c4d47da088c469db637c6be5ae9210347f7f4e8
Parent: 66d9602
Committed by GitHub <noreply@github.com>
on 9/1/2026, 1:49:15 PM