Skip to content
Snippets Groups Projects

Fixing Concurrency Issues with TypeMapper

Closed Sabarish K R E requested to merge sabz/typeMapperConcurrencyFix into master
1 unresolved thread

test case demonstrating a thread-unsafe operation of IndexerMappingServiceImpl.getIndexMappingFromRecordSchema(..) and the fix for that

Conflicts:

indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java

Merge request reports

Merge request pipeline #257457 failed

Pipeline: Indexer

#257458

    Merge request pipeline failed for 5f8bf248

    5 environments impacted.
    Approved by

    Closed by David DiederichDavid Diederich 5 months ago (Oct 11, 2024 2:32am UTC)

    Merge details

    • The changes were not merged into master.

    Activity

    Filter activity
    • Approvals
    • Assignees & reviewers
    • Comments (from bots)
    • Comments (from users)
    • Commits & branches
    • Edits
    • Labels
    • Lock status
    • Mentions
    • Merge request status
    • Tracking
    225 231 }
    226 232
    233 @Test
    234 public void should_returnCorrectMapping_duringConcurrentCalls() throws Exception {
    235
    236 /* We attempt to call the function IndexerMappingServiceImpl.getIndexMappingFromRecordSchema concurrently for
    237 * two differ kinds concurrently. You can observe that this operation is not threadsafe, and one of the two
    238 * responses will have an incorrect value for the authority. Kind 1 either has Kind 2's authority or vice-versa.
    239 */
    240
    241 Gson gson = new GsonBuilder().serializeNulls().create();
    242 ExecutorService executor = Executors.newFixedThreadPool(10);
    243
    244 int totalRuns = 10;
    245 for (int x = 0; x < totalRuns; x++) {
    246 System.out.println(String.format("------- Run %d/%d ----", (x + 1), totalRuns));
  • Please register or sign in to reply
    Loading