Skip to content

TTL Znode doesn't expire in Test envs #3036

@LZD-PratyushBhatt

Description

@LZD-PratyushBhatt

Describe the bug

The issue is related to ZooKeeper's TTL (Time-To-Live) node functionality and specifically how it behaves in the embedded ZooKeeper environment used in tests.

In a normal ZooKeeper deployment, a background ContainerManager thread runs periodically to clean up expired TTL nodes. However, in the embedded ZooKeeper used for testing, this background thread doesn't appear to be functioning properly. The ContainerManager is designed to run on a configurable schedule (default is 60 seconds), but in the test environment, this cleanup process doesn't happen.

To Reproduce

Trigger testSyncCreateWithTTL() in debug mode while setting up a breakpoint here, then analyse the znode in zk. It will never be cleaned up.

Expected behavior

The znodes should get cleaned up in the integration tests once the TTL expires

Additional context

The tests that target PERSISTENT_WITH_TTL are incomplete. They dont check if the znode is removed or they just remove the znode manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions