-
Notifications
You must be signed in to change notification settings - Fork 98
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
It's not possible to issue a second http call #40
Comments
Reproducible example: Cargo.toml:
lib.rs:
envoy config:
Make an http request to the proxy:
As a result envoy crashes due to multiple mutable borrows:
|
Thanks for the report and reproducer! I think your patch is correct. Could you send a PR? |
Hi @SvetlinZarev, I see that you pushed fix to your fork (https://github.com/SvetlinZarev/proxy-wasm-rust-sdk/commit/5190a0437c9c96ec378839598793ea98fc6769e8), but you didn't open a PR. Could you do that or are you still working on it? |
Unfortunately I'm struggling with the OSS process at my place :( (due to the required CLA). |
Do you have any ETA or is that unlikely to happen at all? |
Signed-off-by: Takeshi Yoneda <[email protected]>
Hi,
Currently it's not possible to issue another http call from
Context::on_http_call_response
. Is this intentional ? If it is how is one supposed to make several http calls, for example fetch an oauth token, call another service with it, then resume the request ?The error is:
I believe the error is caused because the dispatcher tries to borrow the callouts for a second time when registering the second http call.
The first borrow occurs when calling the on_http_call_response callback. The duration of the borrow lasts for the whole
if let Some()
body.Given that the context_id is
Copy
, this method can be modified like that:Thus eliminating the borrow on the
callouts
member, which resolves the issue.What do you think ?
The text was updated successfully, but these errors were encountered: