Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding `command_timeout` option for run() #645
Adding a parameter command_timeout for run() calls,
This implementation would enable fabric to use this new parameter on it's paramiko
6 times, most recently
Jul 2, 2019
My personal checklist for this (will branch and hack shortly):
Notes for posterity about tweaks I'm making here:
Here's an interesting wrinkle, this patch implicitly decides that we don't timeout if
Arguably, there's precedent, which is that
This is really subtle; in fact I'm not even sure that watcher errors are correct in being exempt from
As for the warn=True, cause that logic was there already ontop of
As the naming of things, I was using something we already had in our code, it can be shorter and clean here.
One more thing to add,
Thanks again for looking into it
Got back on this today. Still a little on the fence about the exception name, but everything else is cleaned up at this point.
I moved the timer implementation to Local where I think it belongs (Runner itself should not know or care about the details, only whether the subprocess is considered to have timed out - thus a new property is born) and most of my above checklist as well - many more tests, including integration, edge cases etc. Docstrings, versionadded's, changelog entry. See https://github.com/pyinvoke/invoke/compare/645-int
Tackling Fabric 2's side should go swiftly, tomorrow, and then I can merge both and move on to other tickets. This all took a lot of effort for w/e reason :(
Did a big ol overhaul based on those comments and I think I like the result better. Runner itself now owns the timer stuff, defines a new API member
This also handily removes a lot of the worry about backwards compatibility - eg a currently-released Fabric 2 trying to use this new Invoke version will only end up invoking a too-new API on an actual timeout - which that version of Fabric won't know how to request. I think. It's been a long day.