cloudflare/pingora · error · std::io::Error

dial9 worker_poll_interval must be greater than zero

Error message

dial9 worker_poll_interval must be greater than zero

What it means

build_dial9_runtime() (pingora-runtime/src/lib.rs:337) rejects worker_poll_interval == Some(Duration::ZERO): the interval at which the dial9 traced runtime polls its worker tasks must be positive if set. None (library default polling) and any positive duration pass; exactly zero is invalid.

Source

Thrown at pingora-runtime/src/lib.rs:337

        return Err(Error::new(
            ErrorKind::InvalidInput,
            "dial9 max_file_size must be greater than zero",
        ));
    }
    if opts.max_total_size == 0 {
        return Err(Error::new(
            ErrorKind::InvalidInput,
            "dial9 max_total_size must be greater than zero",
        ));
    }
    if opts.max_file_size > opts.max_total_size {
        return Err(Error::new(
            ErrorKind::InvalidInput,
            "dial9 max_file_size must be less than or equal to max_total_size",
        ));
    }
    if opts.worker_poll_interval == Some(Duration::ZERO) {
        return Err(Error::new(
            ErrorKind::InvalidInput,
            "dial9 worker_poll_interval must be greater than zero",
        ));
    }

    if let Some(parent) = opts.trace_path.parent() {
        std::fs::create_dir_all(parent)?;
    }

    let writer = RotatingWriter::builder()
        .base_path(opts.trace_path.clone())
        .max_file_size(opts.max_file_size)
        .max_total_size(opts.max_total_size)
        .maybe_rotation_period(opts.rotation_period)
        .build()?;

    let mut traced = TracedRuntime::builder()
        .with_trace_path(opts.trace_path.clone())

View on GitHub (pinned to 0046038bd4)

Solutions

  1. Remove the explicit value and leave worker_poll_interval as None to use the default polling
  2. Or set a small positive interval, e.g. Some(Duration::from_millis(100))
  3. Map config values of 0 to None at your config layer instead of passing Duration::ZERO through

Example fix

// before
let opts = Dial9RuntimeOpts { worker_poll_interval: Some(Duration::ZERO), ..Default::default() };

// after
let opts = Dial9RuntimeOpts { worker_poll_interval: Some(Duration::from_millis(100)), ..Default::default() };
Defensive patterns

Strategy: validation

Validate before calling

if opts.worker_poll_interval == Some(std::time::Duration::ZERO) {
    return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput,
        "worker_poll_interval must be None or a positive duration"));
}

Prevention

When it happens

Trigger: Explicitly configuring Dial9RuntimeOpts.worker_poll_interval = Some(Duration::ZERO), typically an attempt to 'disable' the poll delay or a config default of 0 that slipped through deserialization.

Common situations: Tuning observability polling from an env var that defaults to '0'; porting configs where 0 meant 'fastest'; misunderstandings that zero means 'off' when off is represented by None.

Related errors


AI-assisted analysis of cloudflare/pingora@0046038bd4 (2026-08-16). Data as JSON: /api/errors/a21674ddb2d91946. Report an issue: GitHub.