Skip to content

[BUG] Service Map does not rotate with multiple workers #5901

Closed

Description

@dlvenable

Describe the bug

The service_map is no longer rotating its windows.

The cause of this issue is that with the introduction of #5794, the @SingleThread annotation is not functioning as expected. Only the last @SingleThread processor instances is called by all threads after this commit.

Activity

  1. self-assigned this
    on Jul 25, 2025
  2. added a commit that references this issue on Jul 25, 2025
    f4a17ba
  3. dlvenable commented on Jul 25, 2025

    @dlvenable
    MemberAuthor

    The change in #5794 was giving the exact same list of Processor instances to each ProcessWorker. This means that for @SingleThread-annotated processors, only one instance was used. However, the intent of @SingleThread is to have a class instance per thread.

    This impacted the service_map because of this code:

    if (isMasterInstance()) {
    processIsolatedServiceMapNodes(serviceDependencyRecords);
    rotateWindows();
    }

    Only one thread should be rotating the windows.

    However, when this code is reached to check for the master instance/thread, the value of thisProcessorId was always ${threadCount}-1. It was never 0. For example, with 2 workers, this was always 1 and with 4 workers it was always 3.

  4. dlvenable commented on Jul 25, 2025

    @dlvenable
    MemberAuthor

    This is the specific code that resulted in this error.

    https://github.com/opensearch-project/data-prepper/pull/5794/files#diff-c53121f9198a1e12abd1fb099ce0e9fe0840f13a3b6044d4f2a15772332cf519R239-R240

    Each call to this.processorRegistry.swapProcessors(processors); results in swapping out the processors. So only the final processors list is used.

    I fixed this in #5902 by providing the ProcessorsProvider directly to each ProcessWorker.

  5. added this to the v2.13 milestone on Jul 25, 2025
  6. added a commit that references this issue on Jul 25, 2025
    53f16d7
  7. added a commit that references this issue on Jul 25, 2025
    1221178
  8. added a commit that references this issue on Jul 28, 2025
    73ff2ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions