Skip to content

chore(deps): Update tower to v0.5 #23186

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
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Serendo
Copy link

@Serendo Serendo commented Jun 11, 2025

  • Adjustments of Buffer type definition in Tower 0.5
  • As policy is directly modified in Tower 0.5. Removed the policy part in the RetryPolicyFuture.
  • The change args to mutable for the retry function and clone_request function. It's changed in Tower 0.5.
  • Changed the RetryPolicyFuture Output to (). This is also changed in Tower 0.5.
  • Modified some tests as policy is now modified in advance function;

Summary

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • The CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
      • ./scripts/check_changelog_fragments.sh
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run cargo vdev build licenses to regenerate the license inventory and commit the changes (if any). More details here.

References

#22431

Serendo added 3 commits June 11, 2025 14:27
- Adjustments of Buffer type definition in Tower 0.5
- As policy is directly modified in Tower 0.5. Removed the policy part in the RetryPolicyFuture.
- The change args to mutable for the retry function and clone_request function. It's changed in Tower 0.5.
- Changed the RetryPolicyFuture Output to (). This is also changed in Tower 0.5.
- Modified some tests as policy is now modified in advance function;
…these stats ranges are related with the test params.
@Serendo Serendo requested a review from a team as a code owner June 11, 2025 07:17
@github-actions github-actions bot added the domain: sinks Anything related to the Vector's sinks label Jun 11, 2025
Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

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

Found a couple of bugs otherwise LGTM

self.previous_duration + self.current_duration,
self.max_duration,
);
self.remaining_attempts -= 1;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.remaining_attempts -= 1;
self.remaining_attempts = self.remaining_attempts.saturating_sub(1);

Comment on lines +112 to +115
let next_duration: Duration = cmp::min(
self.previous_duration + self.current_duration,
self.max_duration,
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let next_duration: Duration = cmp::min(
self.previous_duration + self.current_duration,
self.max_duration,
);
let sum = self.previous_duration.checked_add(self.current_duration)
.unwrap_or(Duration::MAX);
let next_duration = cmp::min(sum, self.max_duration);

Example:

previous_duration = 30s
current_duration = 40s
max_duration = 60s
next_duration = 60s

@pront pront changed the title Update tower to 0.5 chore(deps): Update tower to v0.5 Jun 11, 2025
@pront pront added domain: deps Anything related to Vector's dependencies no-changelog Changes in this PR do not need user-facing explanations in the release changelog labels Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: deps Anything related to Vector's dependencies domain: sinks Anything related to the Vector's sinks no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants