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

Allow Tesla.Middleware.Fuse options to set the ask mode #493

Merged
merged 1 commit into from
Dec 17, 2021

Conversation

seancribbs
Copy link

Under high load, forcing all calls to :fuse.ask/2 to be synchronous (sent
through the fuse_server process) can result in a deep mailbox and timeouts
inside the middleware (hitting the default call timeout of 5s). This commit adds
a mode option to the middleware that lets the user select :async_dirty so
that the fuse_server process can be bypassed.

In the documentation, I tried to be explicit that choosing :async_dirty might
result in drift, meaning that a given process might read the fuse state from
ets and it would not account for melts or resets that are in the mailbox of
the fuse_server process.

Because of potential side-effect/timing issues, it wasn't clear how to test this
change. Any guidance there is appreciated!

Under high load, forcing all calls to `:fuse.ask/2` to be synchronous (sent
through the `fuse_server` process) can result in a deep mailbox and timeouts
inside the middleware (hitting the default call timeout of 5s). This commit adds
a `mode` option to the middleware that lets the user select `:async_dirty` so
that the `fuse_server` process can be bypassed.

In the documentation, I tried to be explicit that choosing `:async_dirty` might
result in drift, meaning that a given process might read the fuse state from
`ets` and it would not account for melts or resets that are in the mailbox of
the `fuse_server` process.

Because of potential side-effect/timing issues, it wasn't clear how to test this
change. Any guidance there is appreciated!
@teamon teamon merged commit 7aa692a into elixir-tesla:master Dec 17, 2021
@seancribbs seancribbs deleted the fuse-async branch December 17, 2021 14:55
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.

2 participants