Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Goroutine started on init() function #1074

Open
adrianlzt opened this issue Mar 20, 2019 · 4 comments
Open

Goroutine started on init() function #1074

adrianlzt opened this issue Mar 20, 2019 · 4 comments

Comments

@adrianlzt
Copy link

Describe the bug
In this init() function a gorouting is fired.

This looks like an strange behaviour for a lib, because any program importing this lib will have your goroutine running.
Found looking for a problem in Telegraf: influxdata/telegraf#5612

@aarondl
Copy link

aarondl commented Apr 10, 2019

Found this goroutine running during my tests today. This strikes me as extremely bad practice to start unwanted goroutines no matter how "cheap" they are. If the package requires a Goroutine to run, starting it should be part of the public API that users have to start themselves.

@ncw
Copy link

ncw commented Aug 8, 2019

Likewise importing these google APIs will also start the mystery go routine

  • google.golang.org/api/drive/v2
  • google.golang.org/api/drive/v3
  • google.golang.org/api/storage/v1

@mholt
Copy link

mholt commented Mar 9, 2020

I can't explain how, but I believe this goroutine has a serious bug causing the CPU to spin, and somehow blocking program start. Reported in: #1200

@james-lawrence
Copy link

agreed this should not be happening. i had to investigate wtf the library was and whether it posed a security risk to my application.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants