Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provisioner CompleteJob should do all db operations in a transaction #17694

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

Open
Emyrk opened this issue May 6, 2025 · 0 comments
Open

Provisioner CompleteJob should do all db operations in a transaction #17694

Emyrk opened this issue May 6, 2025 · 0 comments

Comments

@Emyrk
Copy link
Member

Emyrk commented May 6, 2025

func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) (*proto.Empty, error) {

Is a 600 line function that does a lot of db mutations. No transaction is used, so partial db mutations can be applied.

This function should be refactored into smaller functions, and do all it's work in a tx.

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

No branches or pull requests

1 participant