Skip to content

Conversation

@landonxjames
Copy link
Contributor

@landonxjames landonxjames commented Dec 23, 2025

Still needs tests, but want to see if it breaks any existing CI first

Motivation and Context

Closes #4459, WASM users were seeing runtime errors because some new functionality added to the TokenBucket was creating a default TimeSource that used SystemTime. WASM is sandboxed and doesn't have access to SystemTime, so this caused a panic.

Description

I updated the TokenBucket creation to initialize the bucket with the user-provided TimeSource from the Config

Added a task to #2499 to update our WASM integration tests to make sure we catch issues like this in the future.

Testing

Added integration test to ensure that the TokenBucket for an operation picks up the TimeSource from the Config if it is set.

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.
  • For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "aws-sdk-rust" in the applies_to key.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames marked this pull request as ready for review December 24, 2025 05:52
@landonxjames landonxjames requested review from a team as code owners December 24, 2025 05:52
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.

[Bug] TokenBucket ignores configured TimeSource and panics on WASM due to hardcoded SystemTime::now()

1 participant