On Thu, Dec 7, 2023, at 10:17 AM, Dmitry Tantsur wrote:
On 12/7/23 18:17, Clark Boylan wrote:
On Thu, Dec 7, 2023, at 9:09 AM, Michael Johnson wrote:
I did not split the patches for adding the new method and removing the old wsgi-scripts because I think we should just pull the bandaid off here. It's one of those situations where the distros and/or pip/setuptools are just going to break. We are either going to break people that expect the scripts now or in the future. I also found that the script generated by PBR is not handling the thread lock correctly (pylint complained when I created the wsgi module), so it's even slightly broken now (not that I'm 100% sure it would matter in practice).
If this is an issue we should probably fix it. That said https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/useless-... appears to be the only lock related message in pylint and PBR is doing what is suggested: https://opendev.org/openstack/pbr/src/branch/master/pbr/packaging.py#L378-L3.... I'm not sure what the problem would be given that.
Isn't it the same issue though? You're using a lock that you've just created, nothing else can use the same lock (if this code is called twice, it will create two locks). At least the lint may not understand the intentions there (given that I don't understand them either, and our computing overlords are only becoming smarter than me).
https://review.opendev.org/c/openstack/pbr/+/217733 introduced this code to PBR. The assertion seems to be that application is a global object, and I guess assumed that anything in that scope is also global? I don't know enough about mod_wsgi to know for sure. It is entirely possible that creating the lock, grabbing the lock, and checking if application is None was enough of a race condition reordering that the problem wasn't seen despite the lock being useless as a proper lock.
Dmitry