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

Allow multiple instances of IPCMessageSubscriber in one process #51963

Merged
merged 8 commits into from Mar 27, 2019

Conversation

@DmitryKuzmenko
Copy link
Contributor

commented Mar 4, 2019

What does this PR do?

Updates IPCMessageSubscriber to be instantiated and read simultaneously. To do this I'm introducing an IPCMessageSubscriberService that is the old IPCMessageSubscriber singleton. It's instantiated once and it controls that the socket reading is started once any subscriber want's to read data and stopped when there still no subscribers.
IPCMessageSubscriber is subscribing to data read by the service and reading the data from the async queue not dire

What issues does this PR fix or reference?

Fixes: #49147

Previous Behavior

The second parallel try to read data with IPCMessageSubscriber raises socket error while another reading is in progress.

New Behavior

IPCMessageSubscriber can be used anywhere without taking care of other parts of client code.

Tests written?

Yes, regression.

Commits signed with GPG?

Yes

@DmitryKuzmenko DmitryKuzmenko force-pushed the DSRCorporation:bugs/49147_ipc_subscriber branch from 19d17c6 to ab41558 Mar 5, 2019
@DmitryKuzmenko DmitryKuzmenko force-pushed the DSRCorporation:bugs/49147_ipc_subscriber branch from ab41558 to 710ab50 Mar 5, 2019
salt/transport/ipc.py Show resolved Hide resolved
salt/transport/ipc.py Show resolved Hide resolved
salt/transport/ipc.py Show resolved Hide resolved
salt/transport/ipc.py Show resolved Hide resolved
Copy link
Contributor

left a comment

Just a documentation change... if you wanna

salt/transport/ipc.py Outdated Show resolved Hide resolved
@DmitryKuzmenko DmitryKuzmenko force-pushed the DSRCorporation:bugs/49147_ipc_subscriber branch from 07810a3 to cc46e9c Mar 27, 2019
@DmitryKuzmenko

This comment has been minimized.

Copy link
Contributor Author

commented Mar 27, 2019

@dwoz, @s0undt3ch are you ok with this now?

@dwoz
dwoz approved these changes Mar 27, 2019
@dwoz dwoz merged commit 7b2b521 into saltstack:2018.3 Mar 27, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
DmitryKuzmenko referenced this pull request in garethgreenaway/salt Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.