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

[master] Prevent using SyncWrapper with no reason #66510

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vzhestkov
Copy link
Contributor

@vzhestkov vzhestkov commented May 13, 2024

What does this PR do?

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:

salt/salt/utils/event.py

Lines 231 to 236 in e5eee2f

if io_loop is not None:
self.io_loop = io_loop
self._run_io_loop_sync = False
else:
self.io_loop = None
self._run_io_loop_sync = True

And that's why is using salt.utils.asynchronous.SyncWrapper here:

salt/salt/utils/event.py

Lines 322 to 331 in e5eee2f

if self._run_io_loop_sync:
if self.subscriber is None:
self.subscriber = salt.utils.asynchronous.SyncWrapper(
salt.transport.ipc_publish_client,
args=(
self.node,
self.opts,
),
loop_kwarg="io_loop",
)

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, including the
PR Guidelines.

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

@vzhestkov vzhestkov requested a review from a team as a code owner May 13, 2024 11:52
@vzhestkov vzhestkov requested review from felippeb and removed request for a team May 13, 2024 11:52
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Prevent using SyncWrapper with no reason [master] Prevent using SyncWrapper with no reason May 13, 2024
@s0undt3ch s0undt3ch requested a review from dwoz May 13, 2024 16:13
@dwoz
Copy link
Contributor

dwoz commented May 17, 2024

@vzhestkov
This change should likely be made in 3006.x and get merged forward.

@dwoz
Copy link
Contributor

dwoz commented May 27, 2024

@vzhestkov This change should likely be made in 3006.x and get merged forward.

@vzhestkov ping

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

Successfully merging this pull request may close these issues.

None yet

2 participants