[SERVER-32614] update_test_lifecycle may fail because datetime.strptime() is not thread safe Created: 09/Jan/18  Updated: 30/Oct/23  Resolved: 16/Jan/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.6.3, 3.7.2

Type: Bug Priority: Major - P3
Reporter: Yves Duhem Assignee: Yves Duhem
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: TIG 2018-1-29
Participants:
Linked BF Score: 0

 Description   

The update_test_lifecycle.py script fetches the test history in multiple threads.
In these threads the code calls the test_failures module which uses the datetime.strptime() method.
As filed in https://bugs.python.org/issue7980, that method does not import _strptime.py in a thread safe way.
This can lead to the following error: AttributeError: 'module' object has no attribute '_strptime'.

We need to implement a workaround: either calling the strptime() method or importing the _strptime module explicitly before starting the threads.



 Comments   
Comment by Githook User [ 25/Jan/18 ]

Author:

{'name': 'Yves Duhem', 'email': 'yves.duhem@mongodb.com', 'username': 'syev'}

Message: SERVER-32614 Remove usage of non-threadsafe strptime()

(cherry picked from commit 07031843f1868a956b28f9e0e4d546cce4badfbf)
Branch: v3.6
https://github.com/mongodb/mongo/commit/317b76ca638a41ba3135386db3251492e8b9e310

Comment by Githook User [ 16/Jan/18 ]

Author:

{'email': 'yves.duhem@mongodb.com', 'name': 'Yves Duhem', 'username': 'syev'}

Message: SERVER-32614 Remove usage of non-threadsafe strptime()
Branch: master
https://github.com/mongodb/mongo/commit/07031843f1868a956b28f9e0e4d546cce4badfbf

Comment by Yves Duhem [ 16/Jan/18 ]

Resolved by removing the use of strptime() from test_failures.py.

Generated at Thu Feb 08 04:30:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.