Task queue persistence retention period

Hi everyone, How long temporal task queues get persisted? Does temporal has any mechanism for cleaning task queues

Task queue that have no task for more than 48 hours are considered stale and will be removed.

Does that mean a task queue contains one ore more pending tasks will never get removed?

Depends. Tasks or “normal” task queue partitions can have TTL in case you set workflow run/execution timeout in workflow options (so they can expire).
Tasks on sticky task queues have low ttl and if expired are recreated on “normal” task queue partition.

Worker service does have internal workflow (task queue scavenger) which removes task queues that have no tasks (or tasks are expired due to ttl). Note that this scavenger does not run for Cassandra persistence.
Sticky task queues do have 24hr ttl.

Thank you @tihomir for clarifying.