Skip to content

Stop scheduler on StatelessRegistry close - #1259

Merged
brharrington merged 1 commit into
Netflix:mainfrom
brharrington:stateless-registry-close
Jun 25, 2026
Merged

Stop scheduler on StatelessRegistry close#1259
brharrington merged 1 commit into
Netflix:mainfrom
brharrington:stateless-registry-close

Conversation

@brharrington

Copy link
Copy Markdown
Contributor

StatelessRegistry started a publishing Scheduler in start() and shut it down only in stop(), but did not override close(). The inherited AbstractRegistry.close() cleared the meters but left the scheduler thread running, so closing the registry leaked the spectator-reg-stateless thread (and skipped the final flush), unlike AtlasRegistry whose close() calls stop().

Override close() to stop() the scheduler and then super.close() to release the remaining state, mirroring AtlasRegistry. Adds tests that the scheduler thread is stopped after close() and that closing a never-started registry does not throw.

StatelessRegistry started a publishing Scheduler in start() and shut it down
only in stop(), but did not override close(). The inherited
AbstractRegistry.close() cleared the meters but left the scheduler thread
running, so closing the registry leaked the spectator-reg-stateless thread
(and skipped the final flush), unlike AtlasRegistry whose close() calls stop().

Override close() to stop() the scheduler and then super.close() to release the
remaining state, mirroring AtlasRegistry. Adds tests that the scheduler thread
is stopped after close() and that closing a never-started registry does not
throw.
@brharrington brharrington added this to the 1.10.0 milestone Jun 25, 2026
@brharrington
brharrington merged commit b2586bf into Netflix:main Jun 25, 2026
1 check passed
@brharrington
brharrington deleted the stateless-registry-close branch June 25, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant