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

Blocking call detected #647

Closed
drc38 opened this issue Jun 12, 2024 · 3 comments
Closed

Blocking call detected #647

drc38 opened this issue Jun 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@drc38
Copy link
Contributor

drc38 commented Jun 12, 2024

The ocpp integration (https://github.com/lbbrhzn/ocpp) using this library in Home Assistant 2024.06 has detected that the IO open file call in messages.py blocks the event loop.

Would it make sense in charge_point.py to replace calls to validate_payload with the equivalent run in the executor eg await asyncio.get_event_loop().run_in_executor(...,validate_payload,...)?

Or if you have suggestions on how it can be addressed another way that would be great.

Many thanks

@drc38 drc38 added the bug Something isn't working label Jun 12, 2024
@drc38
Copy link
Contributor Author

drc38 commented Jun 13, 2024

Confirmed replacing the calls (eg the below example) fixes the blocking error:

            await asyncio.get_event_loop().run_in_executor(
                None,
                validate_payload,
                msg,
                self._ocpp_version
            )

Let me know if you want me to submit a PR

@koopee
Copy link

koopee commented Jun 20, 2024

Confirmed replacing the calls (eg the below example) fixes the blocking error:

            await asyncio.get_event_loop().run_in_executor(
                None,
                validate_payload,
                msg,
                self._ocpp_version
            )

Let me know if you want me to submit a PR

I don't really know how the process works, but maybe you should submit PR...

@jainmohit2001
Copy link
Collaborator

FIxed in #652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants