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

Always try to reinitialize Crypto.Random when forking minion process #55635

Merged
merged 1 commit into from
Jan 8, 2020

Conversation

lukasraska
Copy link
Contributor

@lukasraska lukasraska commented Dec 13, 2019

What does this PR do?

Always try to reinitialize Crypto.Random when processing minion events to avoid issues when minion tries to sign something during/after job execution.

What issues does this PR fix or reference?

Fix #55116

Previous Behavior

When having minion configured with option minion_sign_messages: True, any job result event would fail with PID check failed. RNG must be re-initialized after fork() when using RHEL 6 or TCP transport

New Behavior

Minion successfully responds with job result

Tests written?

No, AFAIK the only way how to really test this is to enable minion_sign_messages for integration tests. As this is currently global for all tests, it might affect other tests that inspect raw events (cc @waynew )

Yes

Commits signed with GPG?

Yes

@lukasraska
Copy link
Contributor Author

Added tests + rebased to current master (@Ch3LL)

@lukasraska
Copy link
Contributor Author

Seems like the tests fail on Windows. From the look of it, it might actually be bug in Python (https://bugs.python.org/issue17560), but I have to test it manually on Windows first.

@lukasraska lukasraska force-pushed the fix-crypto-sign branch 2 times, most recently from 7e7b268 to 5a48834 Compare December 30, 2019 20:39
@lukasraska
Copy link
Contributor Author

I've made one fix for Win test, but they still fail (probably because when the fork happens the current process it so big it triggers either the mentioned bug or something else). But I'm not able to reproduce it on clean Win machine and I don't have access to these testing golden images.

Any ideas how to tackle this? Otherwise I will just add skipIf for Windows.

@waynew
Copy link
Contributor

waynew commented Jan 3, 2020

@s0undt3ch or @twangboy would probably have the most knowledge about this. Could either of you weigh in?

tests/support/unit.py Outdated Show resolved Hide resolved
salt/minion.py Outdated Show resolved Hide resolved
@s0undt3ch
Copy link
Collaborator

re-run all full

@s0undt3ch
Copy link
Collaborator

re-run full all

@dwoz
Copy link
Contributor

dwoz commented Jan 6, 2020

@lukasraska Please address @s0undt3ch's comments as well as the windows test failures.

@lukasraska
Copy link
Contributor Author

Rebased, implementation changed as _after_fork_methods hook and force-pushed.

@dwoz, @s0undt3ch

@lukasraska
Copy link
Contributor Author

re-run pr-amazon1-py2
re-run pr-windows2019-py3

@dwoz dwoz merged commit df2bd32 into saltstack:master Jan 8, 2020
@lukasraska lukasraska deleted the fix-crypto-sign branch January 8, 2020 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZRELEASED - Neon retired label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minion returns "No response" for most commands in 2019.2.2 with "RNG" related error
5 participants