basho-labs / riak-mesos-tools

CLI and other tools for interacting with the Riak Mesos Framework.
Apache License 2.0
3 stars 6 forks source link

wait for service commands blow up if you have too large of a timeout #37

Closed travisbhartwell closed 8 years ago

travisbhartwell commented 8 years ago

The various wait-for-service commands (framework, cluster, node, node transfers, and director, each take an optional timeout value for the number of seconds to wait for the service to become available, as is appropriate for each. However, if you set this value too large (I believe I was seeing this when I using values of at least 1200) you get a Python error of "Max Recursion Depth Exceeded".

I apologize, I should have filed this bug when I experienced this so I could have shared the stack trace. I don't currently have an environment up where I could reproduce. Regardless, the problem is that the commands are implemented using recursion and Python doesn't support proper tail recursion optimization. It seems that the appropriate thing would be to do is convert these recursive functions into their iterative counterparts.

For example, the framework wait-for-service command: https://github.com/basho-labs/riak-mesos-tools/blob/master/riak_mesos/commands/cmd_framework.py#L80

I could probably handle this at some point if you don't get to it, but I have a bunch of other things on my plate, too.

sanmiguel commented 8 years ago

Fixes for this have now been merged from PR #39 - all places where we used recursion to handle polling periods have been replaced with a while.

@travisbhartwell I forget whether you're using riak-mesos directly, or inside dcos. Either way, you'll need to reinstall the CLI from riak-mesos-v1.1.x.

Please retest and let me know!

sanmiguel commented 8 years ago

Closing this issue - please feel free to reopen if there are still problems with wait-for-service commands.