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

Warnings on HA version 2022.2 #6

Closed
HepoH3 opened this issue Feb 10, 2022 · 21 comments
Closed

Warnings on HA version 2022.2 #6

HepoH3 opened this issue Feb 10, 2022 · 21 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@HepoH3
Copy link
Contributor

HepoH3 commented Feb 10, 2022

After updating core following warnings are shown:

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 89: self._child.sendline(f"connect")

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 93: self._child.sendline("char-write-cmd 0x000c 0100")

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 60: self._child.sendline(data)

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 102: self._child.sendline(f"disconnect")

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 120: self._child.terminate(force=True)

@ClusterM
Copy link
Owner

Already fixed, check latest commit.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 10, 2022

Already fixed, check latest commit.

Got you. I'll switch to master branch.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 10, 2022

Eh, it still reportiong warnings:

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 89: self._child.sendline(f"connect")

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 102: self._child.sendline(f"disconnect")

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/init.py, line 40: async_dispatcher_send(hass, DISPATCHER_UPDATE)

Detected blocking call inside the event loop. This is causing stability issues. Please report issue for dhcp doing blocking calls at homeassistant/components/dhcp/init.py, line 233: self._discover_hosts = DiscoverHosts()

@ClusterM
Copy link
Owner

ClusterM commented Feb 10, 2022

There is no such line in the kettle_connection.py now:


I just released version 1.1, try it.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 10, 2022

There is no such line in the kettle_connection.py now:

I just released version 1.1, try it.

Now it's better, but last warning remains:

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 73: self._child.sendline(data)

@ClusterM
Copy link
Owner

Hm. I'll check it.

@ClusterM
Copy link
Owner

Sorry, I'm an idiot. Seems like I really fixed it now.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 10, 2022

It seems like it, thank you!
Don't be so hard on yourself your integration is great!

@HepoH3 HepoH3 closed this as completed Feb 10, 2022
@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 10, 2022

Sorry to bother you, but it's not over 😅

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/init.py, line 43: await hass.async_add_executor_job(schedule_poll)

@HepoH3 HepoH3 reopened this Feb 10, 2022
@ClusterM
Copy link
Owner

Please try commit 5ce7163

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 11, 2022

Found another one:

Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 133: self._child.terminate(force=True)

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 11, 2022

I think we need separate brunch for blocking calls which eventually will be merged into master with squashed commits.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 11, 2022

2022-02-11 10:36:46 WARNING (MainThread) [homeassistant.util.async_] Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for skykettle doing blocking calls at custom_components/skykettle/init.py, line 43: hass.async_add_executor_job(schedule_poll, timedelta(seconds=entry.data[CONF_SCAN_INTERVAL]))

@ClusterM
Copy link
Owner

Please try the version 1.2. I also updated my server to 2022.2 and tested it for a while.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 14, 2022

Please try the version 1.2. I also updated my server to 2022.2 and tested it for a while.

There is no wanings at first. But after the night following apeared:

skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 99: self._child = pexpect.spawn("gatttool", ['-I', '-t', 'random', '-b', self._mac], timeout=KettleConnection.BLE_TIMEOUT)

skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 56: await self.hass.async_add_executor_job(self._child.sendline, data)

Also I noticed that I need to disconnect/reconnect my bluetooth dongle about few times a day. I'll try to switch back to earlier versions. If I remember correct, in past there was no such problem (I needed to reconnect dongl but no so frequent).

@ClusterM ClusterM added bug Something isn't working enhancement New feature or request labels Feb 16, 2022
@HepoH3
Copy link
Contributor Author

HepoH3 commented Feb 17, 2022

After few days and core updates I can say that there is far more less warnings for now. But I have repeated times error with following message:

Can't terminate, error (TypeError): async_add_executor_job() got an unexpected keyword argument 'force'
Source: custom_components/skykettle/kettle_connection.py:140

@ClusterM
Copy link
Owner

After few days and core updates I can say that there is far more less warnings for now. But I have repeated times error with following message:

Can't terminate, error (TypeError): async_add_executor_job() got an unexpected keyword argument 'force'
Source: custom_components/skykettle/kettle_connection.py:140

Fixed in the latest commit, thank you.

@HepoH3
Copy link
Contributor Author

HepoH3 commented Aug 7, 2022

It's started again:

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 116: if self._child and self._child.isalive():
Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for skykettle doing blocking calls at custom_components/skykettle/kettle_connection.py, line 64: await self.hass.async_add_executor_job(self._child.sendcontrol, data)

Maybe it's kinda connected to new bluetooth integration from HA 2022.08, dunno.

For now I can see bluetooth goes unavailable after some time.

@ClusterM
Copy link
Owner

doing blocking calls at custom_components/skykettle/kettle_connection.py, line 64: await self.hass.async_add_executor_job(self._child.sendcontrol, data)

But it's async call, it can't block by design...

@HepoH3
Copy link
Contributor Author

HepoH3 commented Aug 12, 2022

I think that thing with blocking calls sometimes have a false alarms, or we don't understand something.

@ClusterM
Copy link
Owner

Version from master uses totally new Bluetooth API, so those methods are removed anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants