Use setcheckinterval only if python version is 3.8 since it is no longer exist in higher versions#11432
Conversation
|
Jenkins results:
|
|
Alan, could you please review and merge this PR. It is one of the issue preventing from testing WMCore code in local (laptop) environment using different than 3.8 version of python. |
src/python/WMCore/REST/Main.py
Outdated
| cpconfig.update({'request.methods_with_bodies': ("POST", "PUT", "DELETE")}) | ||
| _thread.stack_size(getattr(self.srvconfig, 'thread_stack_size', 128 * 1024)) | ||
| sys.setcheckinterval(getattr(self.srvconfig, 'sys_check_interval', 10000)) | ||
| if sys.version_info.major == 3 and sys.version_info.minor == 8: |
There was a problem hiding this comment.
Valentin, according to the documentation:
https://docs.python.org/3.8/library/sys.html#sys.setcheckinterval
it has no effect since python 3.2.
So, I think we have two options here:
a) completely remove this check_interval hook; or
b) replace it according to what is suggested in the official documentation: https://docs.python.org/3.8/library/sys.html#sys.setswitchinterval
It's not 100% clear to me whether the unit (secs) is the same between checkinterval and switchinterval. But I'd be inclined to proceed with option b).
|
@vkuznet as we discussed this morning, a friendly ping in case you missed this notification. @mapellidario Hi Dario, I do not know if you guys have a similar code somewhere in the Analysis realm, but I am tagging you here just in case ;) |
|
Alan, I already replied (but it is listed as pending), anyway here is my reply again: Well, here is how sys.setcheckinginterval: described in documentation sys.setcheckinterval(interval)¶ Therefore, I need to know which interval value to use if we'll go option (b) because the current one is in virtual instructions while latter is in seconds. Here is my proposal: Is it acceptable? |
|
Yes, I would keep exactly the same logic as before, just updating the method names. |
Use setcheckinterval only if python version is 3.8 since it is no longer exist in higher versions
dfcc581 to
a1f0622
Compare
|
Jenkins results:
|
|
Jenkins results:
|
Fixes #11310
Status
ready
Description
While I was testing WMCore code using 3.10 python on my macOS I found this issue.
The
setcheckintervalis removed from python codebase, see https://bugs.python.org/issue37392Is it backward compatible (if not, which system it affects?)
YES
Related PRs
External dependencies / deployment changes