Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

[BUG]The request.timeout.ms setting is too large to cause broker full gc or oom #1739

Closed

Description

@keyboardbobo

Describe the bug
The request.timeout.ms setting is too large to cause broker full gc or oom.

The reason is that after the batch data is sent, producePurgatory will not clean up the delayed task DelayedProduceAndFetch in time, it needs to wait until the delayed task expires to trigger the clearing

To Reproduce

  1. request.timeout.ms set relatively large, or even Integer.MAX_VALUE
  2. Start the stress test client
  3. OutOfMemoryError will appear after a while

Expected behavior
The broker runs stably

Activity

  1. BewareMyPower commented on Feb 28, 2023

    @BewareMyPower
    Contributor

    I think you should better setting the publish rate instead of depending on the request.timeout.ms, which was added only to avoid some bugs that make KoP hang.

  2. keyboardbobo commented on Feb 28, 2023

    @keyboardbobo
    ContributorAuthor

    I think you should better setting the publish rate instead of depending on the request.timeout.ms, which was added only to avoid some bugs that make KoP hang.

    The scene of this problem is to use MirrorMaker2 for data migration. It sets the request.timeout.ms = Integer.max_value, so that the problem is caused. If the client is set up by mistake, it is easy to cause cluster stability. To achieve logic, after the Kafka meets the high water level, it will cancel the delay task

  3. BewareMyPower commented on Feb 28, 2023

    @BewareMyPower
    Contributor

    You should set the publish rate to avoid OOM. It's the same for Pulsar.

  4. keyboardbobo commented on Feb 28, 2023

    @keyboardbobo
    ContributorAuthor

    You should set the publish rate to avoid OOM. It's the same for Pulsar.

    23C65840-9AFE-456D-9545-220B336471C3
    We have a small sending rate, but this problem has nothing to do with the rate. It is a memory leak

  5. BewareMyPower commented on Feb 28, 2023

    @BewareMyPower
    Contributor

    Got it. So it can be reproduced by configuring request.timeout.ms with Integer.MAX_VALUE?

  6. keyboardbobo commented on Feb 28, 2023

    @keyboardbobo
    ContributorAuthor

    Got it. So it can be reproduced by configuring request.timeout.ms with Integer.MAX_VALUE?

    request.Timeout.ms configuration value determines the time of the time of the delay task. Set to Integer.MAX_VALUE represents the backlog of the memory forever, and it will not be removed.

  7. BewareMyPower commented on Feb 28, 2023

    @BewareMyPower
    Contributor

    Ideally, this delayed task should be removed once the callback is triggered even if it does not time out. I will write a test to verify it.

  8. keyboardbobo commented on Feb 28, 2023

    @keyboardbobo
    ContributorAuthor

    Ideally, this delayed task should be removed once the callback is triggered even if it does not time out. I will write a test to verify it.

    Yes, it should be removed after all partition tasks are completed. we have fixed it...

  9. BewareMyPower commented on Feb 28, 2023

    @BewareMyPower
    Contributor

    we have fixed it...

    Could you open a PR if you have fixed it?

  10. keyboardbobo commented on Feb 28, 2023

    @keyboardbobo
    ContributorAuthor

    we have fixed it...

    Could you open a PR if you have fixed it?

    Ok, I'll submit the PR late

  11. removed their assignment
    on Mar 1, 2023
  12. added a commit that references this issue on Mar 3, 2023
    7994cd6
  13. added 2 commits that reference this issue on Mar 14, 2023
    5642bf8
    c259340
  14. added a commit that references this issue on Mar 28, 2023
    fc1ad66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions