Skip to content

Cherrypick scheduler panics - #162

Merged
JoshVanL merged 2 commits into
dapr:release-0.18from
cicoyle:cherrypick-scheduler-panics
Jul 29, 2026
Merged

Cherrypick scheduler panics#162
JoshVanL merged 2 commits into
dapr:release-0.18from
cicoyle:cherrypick-scheduler-panics

Conversation

@cicoyle

@cicoyle cicoyle commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

cherrypick both:

#161
#160

cicoyle added 2 commits July 27, 2026 13:22
* fix scheduler panic if user puts in wrong schedule

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
* handle @every with timezone, should not happen

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* PR feedback

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Copilot AI review requested due to automatic review settings July 27, 2026 18:23
@cicoyle
cicoyle requested review from a team as code owners July 27, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cherry-picks fixes to make cron schedule parsing more robust by preventing panics on malformed timezone-prefixed specs and by rejecting unsupported combinations of timezone prefixes with @every interval schedules.

Changes:

  • Avoid panics when parsing timezone-prefixed specs by using whitespace-aware splitting and explicit validation.
  • Reject TZ= / CRON_TZ= prefixes when used with @every <duration> schedules, returning a clear parse-time error.
  • Expand test coverage for timezone parsing, including whitespace handling and DST behavior, and update documentation accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cron/parser.go Hardens timezone prefix parsing and rejects timezone + @every specs.
cron/parser_test.go Adds error cases, whitespace coverage, @every rejection checks, and DST behavior validation.
cron/doc.go Documents that timezone prefixes are not supported for @every <duration> schedules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cron/parser.go
Comment on lines 133 to +140
spec = strings.TrimSpace(spec[i:])

// An @every schedule fires at a fixed interval and has no wall clock for
// a timezone to apply to, so reject the pair rather than silently
// dropping the location.
if strings.HasPrefix(spec, "@every ") {
return nil, fmt.Errorf("timezone is not supported for @every schedules: %s", prefixed)
}
@JoshVanL
JoshVanL merged commit f556bc7 into dapr:release-0.18 Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants