-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Simplify IPCClient and prevent corrupt messages #52445
Conversation
You had me at "Removes singleton" |
Hi @dwoz ! One question that I have about this is that it seems like it means that from this point forward, callers would have to ensure that they are passing in the current loop or we'll end up with the potential for multiple loops per-thread, which seems bad. The old approach tried to prevent this via the singleton implementation but I don't see those same safeguards in place here. If we're going down this route, should we consider disallowing a loop to even be passed in to an IPC client? |
@cachedout Tornado 5+ disallows multiple io loops per thread now. Moreover they removed the ioloop argument from all tornado API. |
@DmitryKuzmenko Ah, yes. Tornado 5 was going to be my next question. :) That should provide the safety we need in these cases. Will this change ever have to run under < 5 though? |
@cachedout should run good, but let's see. =) |
@cachedout One thing to note is the use of |
Here is a centos 7 Python 2 full test run with these change, there were two failures which look to be un-related: https://jenkinsci.saltstack.com/job/salt-centos-7-py2-dwoz/3/ |
Codecov Report
@@ Coverage Diff @@
## 2018.3 #52445 +/- ##
===========================================
- Coverage 48.78% 32.52% -16.26%
===========================================
Files 1511 1511
Lines 256875 256865 -10
Branches 55626 53866 -1760
===========================================
- Hits 125306 83554 -41752
- Misses 131285 163403 +32118
- Partials 284 9908 +9624
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 2018.3 #52445 +/- ##
=========================================
- Coverage 48.78% 45.48% -3.3%
=========================================
Files 1511 1511
Lines 256875 256870 -5
Branches 55626 55625 -1
=========================================
- Hits 125306 116849 -8457
+ Misses 131285 130529 -756
- Partials 284 9492 +9208
Continue to review full report at Codecov.
|
@dwoz My concern is more about the behavior if one is passed in explicitly. I'm not sure if that's happening anywhere but if it is, could it be an issue? |
FYI, They are unrelated.
On April 10, 2019 4:30:28 AM GMT+01:00, Daniel Wozniak ***@***.***> wrote:
Here is a centos 7 Python 2 full test run with these change, there were
two failures which look to be un-related:
https://jenkinsci.saltstack.com/job/salt-centos-7-py2-dwoz/3/
--
You are receiving this because your review was requested.
Reply to this email directly or view it on GitHub:
#52445 (comment)
Pedro Algarvio @ Phone
|
@cachedout Looking at this again I see that, prior to this change, if a caller passed in an event loop that is not the 'current loop' it would have made a new instance and allowed two loops in the same thread. https://github.com/saltstack/salt/pull/52445/files#diff-d5f1a701c958ed082895806182d4d7fdL246 So I don't think we're loosing anything here. |
What does this PR do?
What issues does this PR fix or reference?
Previous Behavior
We tried to share a single IPCClient across the entire codebase resulting in send calls stomping on each other and creating corrupted messages.
New Behavior
Allow IPCClient to be regular instances
Tests written?
No - Fixing existing tests
Full py2 test suite
Full py3 test suite
Commits signed with GPG?
Yes