Thread.Thread->id_number() sometimes returns same value for different threads
Imported from https://youtrack.roxen.com/issue/PIKE-63
Reported by KG Sterneberg kg@roxen.com
Encountered this problem when writing and running tests for the new Edition Purger. Tried to reproduce the problem in an isolated test but failed.
In order to reproduce, checkout branch kg/PIKE-X-thread-id-number-issue in Print and Roxen repos. Then run the the PurgerTest by executing:
TEST_SUITE=PurgerTest ./start --self-test --tests=rep_archive -DARCHIVE_DEBUG
NB: You need to have Elasticsearch installed and configured on localhost:9200 and test-indices created. Go to the directory scripts
in the Archive repo and execute sh create_indices.sh test
(NB: You must stand in directory 'scripts').
In the debug-log you will see stuff like this: TRACE: Clearing cache. thread id: 140735632249664, Thread: Thread.Thread(0x70000c65a000) TRACE: Clearing cache. thread id: 140735632249664, Thread: Thread.Thread(0x70000c14b000) TRACE: Clearing cache. thread id: 140735632249664, Thread: Thread.Thread(0x70000c351000) TRACE: Clearing cache. thread id: 140735632249664, Thread: Thread.Thread(0x70000c24e000)