Repository navigation
Abstracted Transport - #22453
Abstracted Transport#22453
Conversation
These daemon processes aren't all thread safe, so having the test suite init then fork is disingenuous since that isn't supported anyways.
…hout the minion classes
A bit more clear since there are client and server-side classes
This is an attempt to pull all transport/crypto logic out of the core master classes. Once this is completed we should be able to re-use all of this code for all transport types
…the stack, the master-side funcs need to return a dict of opts which specify which send_func to use
|
I installed tornado to get rid of the import failure :) |
|
None of the lint failures are related to this change. However, if you find some free time, since saltnado is also your work, could you clean those up? probably best in a different PR. |
|
@s0undt3ch #22555 should be our lint fix, I can pull them into this branch to clear the lint failures if we want, but its probably not necessary ;) |
|
OK, buckle up. Here we go. :] |
|
WooHooo! |
|
straps in and throws his hands in the air \o/ |
|
@jacksontj Just an FYI. We're seeing some bumpiness now that we're testing across multiple platforms. Below are the current issues. I'll try to keep this updated as best I can and I'll start looking into these as well: |
|
Hmm, odd that we didn't see that in jenkins yea? If you guys need help looking into stuff I should have some time today :) |
|
Yeah, odd that we didn't see that before. I have no explanation for that. :] If you have a minute and can look, it's always very appreciated. :] |
|
@cachedout Are those 2 easily reproducible on Ubuntu? I ran stuff again locally and I'm unable to repro locally... If so maybe time for another VM ;) |
|
Also, is there a way to see log output from those test failures? |
|
Yes. The build artficats for the two errors listed above are here, respective to the order listed originally: NestedSubTest You can also use 'Console View' on the left of each of those to get results from the test runner itself. If that's not enough, I can spin up a VM and see if I can get these errors to re-occur. I haven't seen them before this, though, so perhaps they are transient? We'll see. :] |
|
Hmm, for both of there there is absolutely nothing in the logs: I wonder if we just provoked some race condition (zeromq has many..) |
|
That would not surprise me even a little bit. :] The thing to do here may be to wait until we get a little more information from the test suite and see which tests continue to be unstable and then try to come up with an easier-to-reproduce test case. |
|
Yea, that might be good. Especially if its specific platforms which show the failures all the time-- we have found weird bugs in the python bindings before which only manifest in some distros (due to versioning). |
|
Indeed. I'll keep an eye on it and start to look for patterns that might be useful. |
|
There's also salt-runtests.log in the build artifacts if Jenkins was able to download it. |
|
@s0undt3ch I think that's what he pasted the logs from, actually. |
|
Oh! :) |
|
Looks like we're having problems on Ubuntu 10 and Ubuntu 12. Seems to be related to pyzmq 13.x. We're looking into it as well, but just a heads up. |
|
@rallytime @cachedout Looks like the name for ZMQIOloop (in the pyzmq bindings) came about in v14.0.0 (before that it was simply IOLoop), if we need to support v13.0.0 we'll have to make some helper function to conditionally import it with the old name. IMO we should just upgrade it ;) |
|
We should still support v13.x... Not every user will be willing to update pyzmq unless its packaged, even though we still have some time before we release this code in a major release. We already advise users to upgrade to v14.x but so far we're not forcing anyone... |
|
Ok, then we'll need to conditionally import... I can throw together a PR in just a minute ;) Assuming the old named one works the same ;) |
There was a problem hiding this comment.
Any specific reason why we don't init the self.stream reference on the class'es __init__ method?
The reason I ask this is because while writing a py.test plugin which should get a salt master and minion running, and because my current test is just to make sure they are up, ie, no interaction besides connecting has happened before the daemons are shutdown, I'm getting the following error:
Exception TypeError: "'NoneType' object is not callable" in <bound method Minion.__del__ of <salt.minion.Minion object at 0x7fa5747fa710>> ignored
Somewhere on the teardown code of, I think zmq, zmq.eventloop.zmqstream becomes None, and, at that stage, in this stream method, we can't even import zmq.eventloop.zmqstream.
However, if I instantiate the stream on class initialization, I no longer get the error.
Before submitting a pull request I just wanted to know why the deferred initialization on the zmqstream...
There was a problem hiding this comment.
I do not know the specific reason for this, nor can I think of one offhand
but @jacksontj would be the one to provide the best insight here.
On Tue, Oct 20, 2015 at 2:04 AM, Pedro Algarvio [email protected]
wrote:
In salt/transport/zeromq.py
#22453 (comment):
'''messages_len = len(messages)# if it was one message, then its old styleif messages_len == 1:payload = self.serial.loads(messages[0])# 2 includes a header which says who should do itelif messages_len == 2:payload = self.serial.loads(messages[1])else:raise Exception(('Invalid number of messages ({0}) in zeromq pub''message from master').format(len(messages_len)))ret = yield self._decode_payload(payload)raise tornado.gen.Return(ret)
- @Property
- def stream(self):
Any specific reason why we don't init the self.stream reference on the
class'es init method?The reason I ask this is because while writing a py.test plugin which
should get a salt master and minion running, and because my current test is
just to make sure they are up, ie, no interaction besides connecting has
happened before the daemons are shutdown, I'm getting the following error:Exception TypeError: "'NoneType' object is not callable" in <bound method Minion.del of <salt.minion.Minion object at 0x7fa5747fa710>> ignored
Somewhere on the teardown code of, I think zmq, zmq.eventloop.zmqstream
becomes None, and, at that stage, in this stream method, we can't even
import zmq.eventloop.zmqstream.However, if I instantiate the stream on class initialization, I no longer
get the error.Before submitting a pull request I just wanted to know why the deferred
initialization on the zmqstream...—
Reply to this email directly or view it on GitHub
https://github.com/saltstack/salt/pull/22453/files#r42465926.
There was a problem hiding this comment.
A simple test.ping will create the stream instance, so, for now, I've sidestepped the issue but my question is still valid.
There was a problem hiding this comment.
This is just simply lazy creation of the socket. This is really just a holdover of what was done before (we didn't make it until it was needed). We can change it up, but we'd have to make sure that all clients of this class are okay with the socket being inited when the class is (since zmq isn't process/thread safe).
There was a problem hiding this comment.
My problem is very particular and seems unrelated to the regular workflow, so, lets leave it alone, at least while an issue regarding regular salt workflow comes up. I can just issue a test.ping(which I actually do need to) for what I'm currently working on...
This is a massive overhaul of the entire transport system within salt (this is the one I mentioned @ SaltConf)
The basic idea in this PR is to abstract out the transport within salt-- since Salt shouldn't care how the bits are shipped to the minion, just that they can and will be. To do this I've taken the "channel" idea and run with it. To do this I've created a "reqchannel" and a "pubchannel" these 2 classes encapsulate the 2 types of messages that salt cares about. For each channel type there are server and client implementations, which means that adding a new transport is simply implementing a base-class and configuring the master.
Now that there is an interface to write transport to I also created a basic TCP implementation which uses the same auth as the current zeromq implementation.
In addition to the abstraction of transport this also introduces tornado as an async programming framework (read: ioloop). This means that we can actually run N transports on a master simultaneously. In addition to making all transport async-- this means we can now make API calls within the master/minion async-- meaning a given MWorker thread could actually have multiple requests in-flight (unlike the single request at a time of today).
In addition to running multiple transports at once this also means we can remove the threading we've been using in MultiMinion and Syndics-- and just use the IOLoop.
There is going to need to be some transition to the new Async interfaces, but this PR includes wrappers which make the async interfaces sync friendly-- so it should be 100% backwards compatible. This just means that if you want your module/runner/etc. to be async (meaning the thread can do something else) you'd have to switch your calls to channels (which are very uncommon) to the async versions.
Before we merge this in I'll need to finish up the docs, but I want to get this opened sooner rather than later to get other people's eyes on it.