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

Upgrading actix-web #291

Open
antiblue opened this issue Sep 20, 2023 · 2 comments
Open

Upgrading actix-web #291

antiblue opened this issue Sep 20, 2023 · 2 comments

Comments

@antiblue
Copy link

Hi all, I started working on upgrading the Actix-Web parts, but I stumble over an issue with Tokio.

Through OPCUASession.connect the function get_server_endpoints_from_url<T> is called and at the end an instance of Session is dropped.
This causes a panic, because Tokio wants to enter a blocking region:

thread 'actix-rt|system:0|arbiter:3' panicked at 'Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.', ...tokio-1.32.0\src\runtime\blocking\shutdown.rs:51:21

I have found running-actix-web-using-tokiomain in Actix-Web's documentation, stating that block_in_place will not work. Unfortunately the backtrace reveals exactly that:

  13: core::ptr::drop_in_place<opcua::client::session::session::Session>
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be\library\core\src\ptr\mod.rs:497
  14: opcua::client::client::Client::get_server_endpoints_from_url<ref$<str$> >
             at ...\opcua\lib\src\client\client.rs:493

Any suggestions on how to fix this?

(The code has been forked here)

@AiyionPrime
Copy link
Contributor

AiyionPrime commented Jul 1, 2024

@antiblue I'm struggling with the same problem. Was just drafting a different example structure in #355, when I hit this error as well. Did you make any progress with this?
I'd really like to see the example having the same actix version as the rest of the code.

@antiblue
Copy link
Author

antiblue commented Jul 1, 2024

No, sorry.

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

No branches or pull requests

2 participants