Skip to content

[Bug] Pulsar logs are truncated when logging to files and Pulsar runs out of direct memory when -Dpulsar.allocator.exit_on_oom=true #17587

Closed

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Version

2.10.x

Minimal reproduce step

It's possible to reproduce the issue when running Pulsar in a configuration where Pulsar logs to log files. (a VM based deployment). To reproduce, configure the direct memory to a low value and stress the broker with sufficient load so that the direct memory runs out.
This problem doesn't appear in Kubernetes environments since logging uses System.out / stdout which flushes after each line by default.

What did you expect to see?

the Pulsar logs should be writted to disk before Pulsar exits the Java process

What did you see instead?

Pulsar log files are truncated and don't contain the last logged lines

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Sep 12, 2022
  2. changed the title [-][Bug] Pulsar logs are truncated when logging to files and Pulsar runs out of direct memory [/-] [+][Bug] Pulsar logs are truncated when logging to files and Pulsar runs out of direct memory when -Dpulsar.allocator.exit_on_oom=true[/+] on Sep 12, 2022
  3. lhotari commented on Sep 12, 2022

    @lhotari
    MemberAuthor

    It seems that LogManager.shutdown(); should be called before Runtime.getRuntime().halt is called in the Pulsar code base.

  4. self-assigned this
    on Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions