Skip to content

SessionConnector::startSessionTimer causes thread leak on dynamic sessionsΒ #1102

@Jallibad

Description

@Jallibad

Describe the bug
AbstractSocketInitiator::createDynamicSession calls AbstractSocketInitiator::startInitiators which then calls SessionConnector::startSessionTimer. SessionConnector::startSessionTimer then creates a new scheduled SessionTimerTask check-in and overwrites the SessionConnector.sessionTimerFuture field with the ScheduledFuture<?> representing the session. When the AbstractSocketInitiator is eventually stopped cancel is called on that field. But if multiple dynamic sessions were added then only the last scheduled session timer is cancelled while all the others continue running.

To Reproduce
Create a SocketInitiator or ThreadedSocketInitiator and then call createDynamicSession multiple times.

Expected behavior
Calling AbstractSocketInitiator::createDynamicSession should not register a new session timer if one is already registered.

system information:

  • OS: any
  • Java version: any
  • QFJ Version: I'm using 2.3.2 but this has likely been around for a while.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions