Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete pause support in batch handling #1356

Merged
merged 5 commits into from
May 15, 2024

Conversation

cdzombak
Copy link
Contributor

Description

This PR allows our batch scheduling logic to take the function's paused_at column into account at the point in time that the batch is being scheduled for imminent execution.

Type of change (choose one)

  • Chore (refactors, upgrades, etc.)
  • Bug fix (non-breaking change that fixes an issue)
  • Security fix (non-breaking change that fixes a potential vulnerability)
  • Docs
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

Checklist

  • I've linked any associated issues to this PR.
  • I've tested my own changes.

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview May 15, 2024 1:43pm

Copy link
Contributor

@BrunoScheufler BrunoScheufler left a comment

Choose a reason for hiding this comment

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

Looking good! Should we also update pkg/execution/executor/service.go:321 to use the new RetrieveAndScheduleBatchWithOpts and pkg/execution/runner/runner.go:619 to use the new AppendAndScheduleBatchWithOpts or do you want to do this separately?

Even if this is not relevant in OSS, we might still want to use the new methods so we can phase out the deprecated ones quickly 😄

AppID uuid.UUID `json:"appID"`
FunctionID uuid.UUID `json:"fnID"`
FunctionVersion int `json:"fnV"`
DeprecatedFunctionPausedAt *time.Time `json:"fpAt,omitempty"` // deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

How long do we need to keep this around? Just until the old consumers are completely phased out and we run an updated version of pkg/execution/executor/service.go:300 that passes FunctionPausedAt to RetrieveAndScheduleBatchWithOpts?

Copy link
Contributor Author

@cdzombak cdzombak May 15, 2024

Choose a reason for hiding this comment

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

Theoretically, I believe we could remove it now, since it's omitempty and no code we've shipped in prod has ever set this field.

For safety, I think we should keep this around until we know all payloads created before this PR is merged have been processed.

@cdzombak
Copy link
Contributor Author

cdzombak commented May 15, 2024

Looking good! Should we also update pkg/execution/executor/service.go:321 to use the new RetrieveAndScheduleBatchWithOpts and pkg/execution/runner/runner.go:619 to use the new AppendAndScheduleBatchWithOpts or do you want to do this separately?

✅ Done in bf2cce0.

@cdzombak cdzombak merged commit c548109 into main May 15, 2024
12 checks passed
@cdzombak cdzombak deleted the cdz/batches-support-new-pause-feature branch May 15, 2024 13:51
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.

None yet

3 participants