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

Change the injection count of fuel in a store from u32 to u64 #3048

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

alexcrichton
Copy link
Member

This commit updates the type of the amount of times to inject fuel in
the out_of_fuel_async_yield to u64 instead of u32. This should
allow effectively infinite fuel to get injected, even if a small amount
of fuel is injected per iteration.

Closes #2927
Closes #3046

This commit updates the type of the amount of times to inject fuel in
the `out_of_fuel_async_yield` to `u64` instead of `u32`. This should
allow effectively infinite fuel to get injected, even if a small amount
of fuel is injected per iteration.

Closes bytecodealliance#2927
Closes bytecodealliance#3046
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

LGTM!

Lest someone complain that u64 is still not infinite (leading to a "reboot your Boeing plane every 248 days" sort of situation), and that we instead need an out-of-band setting that indicates "forever", I did some quick math: if each injection is 1 tick (worst case) and we are limited to u64::MAX injections, at 4B ticks per second, we have 146 years of runtime. That seems reasonable!

@cfallin
Copy link
Member

cfallin commented Jun 30, 2021

... and, reading more of the issue history, I agree that a separate API might make sense for a "truly run forever" situation; it doesn't seem worth API-breakage to change the semantics here.

@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 30, 2021
@github-actions
Copy link

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit b9985fe into bytecodealliance:main Jul 1, 2021
@alexcrichton alexcrichton deleted the more-fueld branch July 1, 2021 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing out_of_fuel_async_yield's injection_count to a u64 type
2 participants