On Thu, Jan 20, 2022, 4:13 AM Daniel P. Berrangé wrote: > On Wed, Jan 19, 2022 at 02:39:16PM -0500, John Snow wrote: > > The old QMP library would actually bind to the server address during > > __init__(). The new library delays this to the accept() call, because > > binding occurs inside of the call to start_[unix_]server(), which is an > > async method -- so it cannot happen during __init__ anymore. > > > > Python 3.7+ adds the ability to create the server (and thus the bind() > > call) and begin the active listening in separate steps, but we don't > > have that functionality in 3.6, our current minimum. > > > > Therefore ... Add a temporary workaround that allows the synchronous > > version of the client to bind the socket in advance, guaranteeing that > > there will be a UNIX socket in the filesystem ready for the QEMU client > > to connect to without a race condition. > > > > (Yes, it's ugly; fixing it more nicely will unfortunately have to wait > > until I can stipulate Python 3.7+ as our minimum version. Python 3.6 is > > EOL as of the beginning of this year, but I haven't checked if all of > > our supported build platforms have a properly modern Python available > > yet.) > > RHEL-8 system python will remain 3.6 for the life of RHEL-8. > > While you can bring in newer python versions in parallel, > IMHO it is highly desirable to remain compatible with the > system python as that's the one you can guarantee users > actually have available by default. > I agree, but over time my hand will be forced. Libraries are beginning to drop support for Python 3.6 upstream, and it's only a matter of time before it becomes implausible to support an EOL python version. I actually go out of my way to ensure compatibility with the very oldest versions I possibly can - *extremely* out of my way - but there's only so much I can reasonably do. Supporting 3.6 and 3.11 simultaneously may prove challenging. Either way, I'm not bumping the version here in this series. I'm just stating that this hack is kind of the best I can (quickly and easily) do until 3.7. (3.7 adds start_server=False to start_unix_server which allows the separation of steps without needing to muck around with the socket object.) > > > Regards, > Daniel > -- > |: https://berrange.com -o- > https://www.flickr.com/photos/dberrange :| > |: https://libvirt.org -o- > https://fstop138.berrange.com :| > |: https://entangle-photo.org -o- > https://www.instagram.com/dberrange : >