Skip to content

remove panic paths from library runtime code #133

@maxcountryman

Description

@maxcountryman

Summary

There are several runtime/library code paths that can panic (assert!, expect, and implicit panics), which is risky for production background workers.

Evidence

  • ZonedSchedule::new uses assert! on IANA name: src/scheduler.rs:63
  • Worker interval conversion uses expect: src/worker.rs:835, src/worker.rs:839
  • enqueue_many_with_chunk_size can panic when chunk_size == 0 (via chunks(0)): src/queue.rs:679

Why this matters

Unexpected panics can crash long-running workers/schedulers and cause avoidable downtime.

Proposed direction

  • Replace panic paths with typed errors.
  • Validate user-provided parameters (chunk_size > 0) early.
  • Keep library behavior failure-typed rather than aborting tasks.

Acceptance criteria

  • Above paths return structured errors and are covered with regression tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions