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

[3007.x] Address minion log flood from zeromq #66231

Closed

Conversation

dismari
Copy link

@dismari dismari commented Mar 14, 2024

What does this PR do?

Checks if callback object in zeromq consume method is not None when handling logging as error.

What issues does this PR fix or reference?

Fixes:
#65898
and
#66177

Previous Behavior

Every minion will see many log errors for an:
TypeError: object NoneType can't be used in 'await' expression
from zeromq callback exception handling

New Behavior

The consume method will now only log an error if there is an exception from with callback.

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.

@dismari dismari requested a review from a team as a code owner March 14, 2024 00:40
@dismari dismari requested review from twangboy and removed request for a team March 14, 2024 00:40
salt/transport/zeromq.py Outdated Show resolved Hide resolved
salt/transport/zeromq.py Outdated Show resolved Hide resolved
@twangboy twangboy requested a review from s0undt3ch March 14, 2024 20:21
twangboy
twangboy previously approved these changes Mar 14, 2024
s0undt3ch
s0undt3ch previously approved these changes Mar 14, 2024
@twangboy
Copy link
Contributor

Looks like you have some pre-commit errors

@SwimGeek
Copy link

Hi

Is there an ETA for this fix to be available (on Debian)?

It's causing lots of our minions to disconnect from master.

@merlinz01
Copy link
Contributor

As I understand it from doing some debugging, the problem is not that the callback is None, but that the callback is a non-async function that is used in an await statement. See my comment, with example. So this PR as it is does not fix the issue.

Here's my understanding of coroutines as it relates to this bug:

When you write await some_function(), that means "call some_function and then await the return value". If some_function is defined with async def, then some_function() immediately returns a coroutine object that can be awaited, which is how this is supposed to work. However, if some_function is defined with a simple def, then it returns None or whatever the function decides to return. When Python gets to the await-ing part, all it has is the return value, which in this case is None. The None object can't be awaited, so it throws the error described.

@dismari
Copy link
Author

dismari commented Mar 26, 2024

My 'fix' (as I described in my PR) is not really fix and rather just removing the unnecessary log which floods the salt minion's logs. As far as I can tell, the code is operational/functional and thus the logging is excessive. I would like someone to resolve the root of the issue but do not have the time/bandwidth (just trying to reduce unnecessary logs in my salt minions).

@twangboy twangboy self-assigned this Mar 27, 2024
Copy link
Contributor

@dwoz dwoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please hold off on merging this until I have a chance to look at it in more detail.

@dwoz dwoz mentioned this pull request Mar 27, 2024
3 tasks
@dismari dismari dismissed stale reviews from s0undt3ch and twangboy via 144bb35 April 25, 2024 20:40
@dwoz
Copy link
Contributor

dwoz commented May 1, 2024

superseded by #66335

@dwoz dwoz closed this May 1, 2024
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.

6 participants