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

Reset the file pointer to the beginning of the file on each retry to send dags to dag server #1656

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/fileutil/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@
if i < args.MaxTries {
retryDelayInMS = backOff(retryDelayInMS, args.BackoffFactor)
}
// Reset the file pointer to the beginning of the file
_, err = file.Seek(0, io.SeekStart)
if err != nil {
return fmt.Errorf("error seeking file: %w", err)

Check warning on line 344 in pkg/fileutil/files.go

View check run for this annotation

Codecov / codecov/patch

pkg/fileutil/files.go#L344

Added line #L344 was not covered by tests
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't find how to produce an error at this line. We can keep it uncovered acc to me.

}
}
return currentUploadError
}
Expand Down