openSUSE / salt

openSUSE and SUSE patches and backports for SaltStack
Apache License 2.0
22 stars 52 forks source link

Prevent using SyncWrapper with no reason #653

Closed vzhestkov closed 3 weeks ago

vzhestkov commented 5 months ago

What does this PR do?

Backport of https://github.com/saltstack/salt/pull/66510

It's not really clear if it was mate intentionally or just the parameter is missing by accident here.

Due to missing io_loop paramerer it's causing setting _run_io_loop_sync to True in SaltEvent object with: https://github.com/openSUSE/salt/blob/4ec5c8bdb8aecac6752c639f494b86c7f8f57ba2/salt/utils/event.py#L235-L240

And that's why is using salt.utils.asynchronous.SyncWrapper here: https://github.com/openSUSE/salt/blob/4ec5c8bdb8aecac6752c639f494b86c7f8f57ba2/salt/utils/event.py#L362-L370

What issues does this PR fix or reference?

Tracks: https://github.com/SUSE/spacewalk/issues/23526

Previous Behavior

SaltEvent is using salt.utils.asynchronous.SyncWrapper with the code which is intended to be used in async way.

New Behavior

salt.utils.asynchronous.SyncWrapper is not used, but direct async calls are used instead.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.