Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: issue 675:goroutine leak when connectionUp(true) return error #677

Closed
wants to merge 1 commit into from

Conversation

kiqi007
Copy link
Contributor

@kiqi007 kiqi007 commented May 19, 2024

bug: #675

fix:
···
if err := connectionUp(true); err != nil {
ERROR.Println(CLI, err)

	/* issue 675:goroutine leak when connectionUp(true) return error
	 *   Only when status == disconnecting will this logic be executed.
	 * The goroutine that changes the status to disconnecting should be
	 * responsible for resource cleanup (which is indeed how it is done).
	 *
	 *   Being disconnected right when the connection is established is a special case.
	 * Even if we remove this check for connectionUp(true), the program must still function correctly,
	 * as if a Disconnect event occurred immediately after connectionUp(true) completed.
	 */

	//close(c.stop) // Tidy up anything we have already started
	//close(incomingPubChan)
	//c.workers.Wait()
	//c.conn.Close()
	//c.conn = nil
}

···

@kiqi007 kiqi007 closed this May 19, 2024
@kiqi007 kiqi007 deleted the fix/goroutine_leak branch May 19, 2024 15:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant