Summary
--neuron.events_retention_size is declared with type=str in allways/utils/config.py:44-49,
but the default is an int and the value is passed to RotatingFileHandler(maxBytes=...). Any operator who passes the flag on the CLI gets a string, which crashes the stdlib rollover check:
TypeError: '>' not supported between instances of 'str' and 'int'
Impact
- Default path (operator doesn't pass the flag): works.
default=2 * 1024 * 1024 * 1024 is already an int, so maxBytes is typed correctly.
- Tuned path (operator passes
--neuron.events_retention_size <value>): the value becomes a str, and RotatingFileHandler.shouldRollover() does self.maxBytes > 0 on every log write. The first rollover — which happens as soon as the event log crosses the threshold — raises TypeError and kills the logger thread (or propagates, depending on the neuron's event loop).
Latent because most operators rely on the 2 GB default, so the bug only surfaces for operators who deliberately tune event retention.
Reproduction
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'--neuron.events_retention_size',
type=str,
default=2 * 1024 * 1024 * 1024,
)
# Default path — value stays int
args = parser.parse_args([])
# getattr(args, 'neuron.events_retention_size') == 2147483648 (int) ✓
# CLI path — argparse coerces to str, breaks RotatingFileHandler
args = parser.parse_args(['--neuron.events_retention_size', '1000000000'])
# getattr(args, 'neuron.events_retention_size') == '1000000000' (str)
# Downstream: RotatingFileHandler.shouldRollover does `self.maxBytes > 0`
# TypeError: '>' not supported between instances of 'str' and 'int'
Affected code paths
Summary
--neuron.events_retention_sizeis declared withtype=strinallways/utils/config.py:44-49,but the default is an int and the value is passed to
RotatingFileHandler(maxBytes=...). Any operator who passes the flag on the CLI gets a string, which crashes the stdlib rollover check:Impact
default=2 * 1024 * 1024 * 1024is already an int, somaxBytesis typed correctly.--neuron.events_retention_size <value>): the value becomes astr, andRotatingFileHandler.shouldRollover()doesself.maxBytes > 0on every log write. The first rollover — which happens as soon as the event log crosses the threshold — raisesTypeErrorand kills the logger thread (or propagates, depending on the neuron's event loop).Latent because most operators rely on the 2 GB default, so the bug only surfaces for operators who deliberately tune event retention.
Reproduction
Affected code paths
allways/utils/config.py:44-49— the argparse declaration (root cause)allways/utils/config.py:28— hands the value tosetup_events_loggerallways/utils/logging.py:29-33— passes it asRotatingFileHandler(maxBytes=...)