Skip to content

AbstractTickSpotifyAPI thread leak #15

@tomwmth

Description

@tomwmth

AbstractTickSpotifyAPI#initialize creates a ScheduledExecutorService with one thread to handle ticking. AbstractTickSpotifyAPI#stop does stop execution of the tick task but does NOT shutdown the executor. By default, fixed thread size executors will retain their threads indefinitely regardless of work until they are shutdown. This results in the thread used by the executor never being released, with a new executor being created each time AbstractTickSpotifyAPI#initialize is invoked.

This mainly becomes problematic in long running scenarios where the API is attempting to automatically reconnect but there is no Spotify app (either closed or not installed) and will eventually result in the process running out of resources.

2025-04-19.09-57-21.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions