You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents us at CockroachDB from upgrading to the latest readline.
The problem is that the global var Stdin is set to a CancelableStdin object but this object is never closed, so there is a goroutine remaining when the program using readline terminates. This makes leak checkers unhappy.
The better solution would be to create an API for readline to "initialize" and "finalize" the entire library. The CancelableStdin object would be created in "initialize" and closed in "finalize". This way, if a program (like cockroach) merely imports the readline package but does not actually use it, there will be no goroutine created.
The text was updated successfully, but these errors were encountered:
Thanks for the hint. However the failure was unrelated to the sql client, it occurs also when we run a Go test for the cli package. The leak occured because cli links to readline and the ioloop goroutine was started even if the test didn't use readline.
I knew that, so I fix that in #77, but I just have a better fix in #78.
You can check the diff in here.
And, It also needs you add defer ins.Close() in sql.
See: https://circleci.com/gh/cockroachdb/cockroach/22259
This prevents us at CockroachDB from upgrading to the latest readline.
The problem is that the global var
Stdin
is set to aCancelableStdin
object but this object is never closed, so there is a goroutine remaining when the program usingreadline
terminates. This makes leak checkers unhappy.The better solution would be to create an API for readline to "initialize" and "finalize" the entire library. The CancelableStdin object would be created in "initialize" and closed in "finalize". This way, if a program (like
cockroach
) merely imports thereadline
package but does not actually use it, there will be no goroutine created.The text was updated successfully, but these errors were encountered: