apache / apache/helix

TTL Znode doesn't expire in Test envs

Open
#3,036 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
504
Forks
255
Avg merge
17d 47m
Merged PRs (30d)
2

Description

### 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()](https://github.com/apache/helix/blob/5de9232d98f0aa4391eebfce51ca61ef72cc1c2e/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java#L246) in debug mode while setting up a breakpoint [here](https://github.com/apache/helix/blob/5de9232d98f0aa4391eebfce51ca61ef72cc1c2e/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java#L272), 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.