[Tile-serving] [openstreetmap/mod_tile] Multithread test fixes (#129)
Eric Stadtherr
notifications at github.com
Fri Jul 8 15:30:07 UTC 2016
This change fixes some threading issues with the multithreading tests in gen_tile_test:
1. The request addition threads ended up putting duplicate render requests on the queue, causing the "number of requests queued" count verifications to fail. There were flaws in the randomization logic in `addition_thread()` that exacerbated the issue, but the biggest flaw was using randomization logic at all. Randomization does not in any way guarantee uniqueness, leading to at least occasional duplicates and therefore test failures. I removed the randomization logic, settling on a combination of thread ID and sequence counter to ensure uniqueness.
1. Access to the sequence counter used for the X coordinate of the synthesized requests was not synchronized between threads. I added a mutex to guard this access.
1. The `SYS_gettid` system call is not supported on MACH / Mac OS X, which also contributed to render request duplication on that platform. I replaced it with a call to `pthread_threadid_np()`.
With these changes, I have not seen any more intermittent failures in the multithreading test cases.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/mod_tile/pull/129
-- Commit Summary --
* fix threading issues in threading tests
* wrap up multithreading fixes to unit test
-- File Changes --
M src/gen_tile_test.cpp (51)
-- Patch Links --
https://github.com/openstreetmap/mod_tile/pull/129.patch
https://github.com/openstreetmap/mod_tile/pull/129.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/mod_tile/pull/129
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20160708/b87ca04c/attachment.html>
More information about the Tile-serving
mailing list