Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

luizalabs/sindico: controllers/watchdog/service.go; 8 LoC #8083

Open
githubvet opened this issue Dec 25, 2020 · 0 comments
Open

luizalabs/sindico: controllers/watchdog/service.go; 8 LoC #8083

githubvet opened this issue Dec 25, 2020 · 0 comments
Labels
fresh no one has ever voted on this issue tiny less than 10 lines of code

Comments

@githubvet
Copy link
Collaborator

Found a possible issue in luizalabs/sindico at controllers/watchdog/service.go

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.

function call which takes a reference to svc at line 73 may start a goroutine

Click here to see the code in its original context.

Click here to show the 8 line(s) of Go which triggered the analyzer.
	for _, svc := range svcs.Items {
		ns := svc.ObjectMeta.Namespace
		if re != nil && re.MatchString(ns) {
			s.logger.Debug("skip ns regex", "ns", ns)
			continue
		}
		s.checkService(cfg, &svc)
	}
Click here to show extra information the analyzer produced.
The following dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
digraph G {
  "(PostMessage, 2)" -> {"(PostMessage, 4)";}
  "(Encode, 0)" -> {"(normalizeFlagName, 1)";}
  "(SetFinalizer, 2)" -> {"(Print, 1)";}
  "(HasPrefix, 2)" -> {"(HasPrefix, 2)";"(timeoutFlush, 1)";}
  "(notify, 2)" -> {"(PostMessage, 2)";}
  "(URL, 0)" -> {"(Encode, 0)";}
  "(isTextResponse, 1)" -> {"(HasPrefix, 2)";}
  "(Pop, 0)" -> {}
  "(parseTokenCmdOutput, 1)" -> {"(parseJSONPath, 3)";}
  "(GetUserInfoContext, 2)" -> {"(userRequest, 4)";}
  "(Unmarshal, 2)" -> {"(convertSliceNumbers, 1)";}
  "(extractUser, 1)" -> {"(GetUserInfo, 1)";}
  "(MessageReceived, 3)" -> {"(handleCmd, 1)";}
  "(WriteSettingsAck, 0)" -> {"(Pop, 0)";}
  "(Token, 0)" -> {"(parseTokenCmdOutput, 1)";}
  "(run, 3)" -> {"(addConnLocked, 2)";}
  "(checkResetOrDone, 0)" -> {}
  "(convertStruct, 3)" -> {}
  "(match, 1)" -> {"(ManageConnection, 0)";"(timeoutFlush, 1)";"(MessageReceived, 3)";"(backup, 1)";"(XMLToStruct, 2)";}
  "(validateDuration, 1)" -> {"(Atoi, 1)";}
  "(handleResponse, 2)" -> {"(setResponseUncompressed, 1)";}
  "(setTargetKind, 2)" -> {"(Token, 0)";}
  "(cancelStream, 0)" -> {"(Context, 0)";}
  "(checkService, 2)" -> {"(GetLabelValue, 2)";"(notify, 2)";}
  "(getDelegate, 0)" -> {"(NewRESTMapper, 2)";}
  "(New, 1)" -> {"(HTTPWrappersForConfig, 2)";}
  "(Error, 0)" -> {"(NewAggregate, 1)";}
  "(normalizeFlagName, 1)" -> {"(ManageConnection, 0)";"(MessageReceived, 3)";"(backup, 1)";}
  "(Close, 0)" -> {"(SetFinalizer, 2)";}
  "(processWindowUpdate, 1)" -> {"(Broadcast, 0)";}
  "(Broadcast, 0)" -> {"(Pop, 0)";}
  "(convertToVersion, 3)" -> {"(setTargetKind, 2)";}
  "(HTTPWrappersForConfig, 2)" -> {"(NewCacheRoundTripper, 2)";}
  "(aggregate, 1)" -> {"(match, 1)";}
  "(Duration, 1)" -> {"(validateDuration, 1)";}
  "(addConnIfNeeded, 3)" -> {"(run, 3)";}
  "(backup, 1)" -> {"(Debug, 3)";}
  "(parseJSONPath, 3)" -> {"(Execute, 2)";}
  "(Convert, 1)" -> {"(convertStruct, 3)";}
  "(convertNumber, 1)" -> {"(Int64, 0)";}
  "(run, 0)" -> {"(assignLevelsToCharactersRemovedByX9, 0)";}
  "(handleCmd, 1)" -> {}
  "(in, 6)" -> {"(assignBracketType, 2)";}
  "(setResponseUncompressed, 1)" -> {"(cancelStream, 0)";}
  "(Execute, 2)" -> {}
  "(DecorateSender, 2)" -> {}
  "(SubResource, 1)" -> {"(transformResponse, 2)";"(Get, 1)";"(Decode, 3)";"(EncodeParameters, 2)";"(Error, 0)";"(tryThrottle, 0)";"(request, 1)";"(Version, 0)";}
  "(PostMessage, 4)" -> {"(Close, 0)";"(Unmarshal, 2)";"(New, 1)";}
  "(convertSliceNumbers, 1)" -> {"(convertNumber, 1)";}
  "(runWithRecovery, 1)" -> {"(Run, 0)";}
  "(processSettings, 1)" -> {"(WriteSettingsAck, 0)";}
  "(Debug, 3)" -> {"(Wrapf, 3)";}
  "(addConnLocked, 2)" -> {"(newClientConn, 2)";}
  "(newRequest, 3)" -> {"(initRequest, 1)";}
  "(Version, 0)" -> {"(String, 0)";}
  "(AddInt64, 2)" -> {}
  "(XMLToStruct, 2)" -> {"(Token, 0)";}
  "(classBeforePair, 1)" -> {"(getStrongTypeN0, 1)";}
  "(Run, 0)" -> {"(run, 1)";}
  "(Wrapf, 3)" -> {"(PutObjectRequest, 1)";}
  "(initRequest, 1)" -> {"(checkResetOrDone, 0)";}
  "(Get, 2)" -> {"(SubResource, 1)";}
  "(Atoi, 1)" -> {"(timeoutFlush, 1)";"(ManageConnection, 0)";"(MessageReceived, 3)";"(backup, 1)";}
  "(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
  "(ManageConnection, 0)" -> {}
  "(assignBracketType, 2)" -> {"(classBeforePair, 1)";}
  "(newClientConn, 2)" -> {}
  "(userRequest, 4)" -> {"(Send, 2)";}
  "(request, 1)" -> {"(Duration, 1)";}
  "(assignLevelsToCharactersRemovedByX9, 0)" -> {"(in, 6)";}
  "(run, 1)" -> {}
  "(Send, 2)" -> {"(SendWithSender, 3)";}
  "(ConvertToVersion, 2)" -> {"(convertToVersion, 3)";}
  "(tryThrottle, 0)" -> {"(URL, 0)";}
  "(processHeaders, 1)" -> {"(handleResponse, 2)";}
  "(Context, 0)" -> {}
  "(SendWithSender, 3)" -> {"(DecorateSender, 2)";}
  "(Get, 1)" -> {"(MapIndex, 1)";}
  "(MapIndex, 1)" -> {"(getDelegate, 0)";}
  "(String, 0)" -> {"(getDelegate, 0)";}
  "(countSparseEntries, 1)" -> {"(timeoutFlush, 1)";"(run, 0)";}
  "(Int64, 0)" -> {"(run, 0)";}
  "(Run, 1)" -> {"(extractUser, 1)";}
  "(GetUserInfo, 1)" -> {"(GetUserInfoContext, 2)";}
  "(NewRESTMapper, 2)" -> {"(output, 5)";"(MessageReceived, 3)";"(backup, 1)";"(configureTransport, 1)";"(Run, 1)";"(ManageConnection, 0)";}
  "(NewAggregate, 1)" -> {"(aggregate, 1)";}
  "(Print, 1)" -> {"(countSparseEntries, 1)";}
  "(NewWithDiskv, 1)" -> {"(processHeaders, 1)";"(configureTransport, 1)";"(runWithRecovery, 1)";"(processSettings, 1)";"(processWindowUpdate, 1)";}
  "(timeoutFlush, 1)" -> {}
  "(output, 5)" -> {"(AddInt64, 2)";}
  "(PutObjectRequest, 1)" -> {"(newRequest, 3)";}
  "(GetLabelValue, 2)" -> {"(Get, 2)";}
  "(Decode, 3)" -> {"(ConvertToVersion, 2)";}
  "(EncodeParameters, 2)" -> {"(Convert, 1)";}
  "(NewCacheRoundTripper, 2)" -> {"(NewWithDiskv, 1)";}
  "(transformResponse, 2)" -> {"(isTextResponse, 1)";}
  "(getStrongTypeN0, 1)" -> {}
}

Leave a reaction on this issue to contribute to the project by classifying this instance as a Bug 👎, Mitigated 👍, or Desirable Behavior 🚀
See the descriptions of the classifications here for more information.

commit ID: 423073b0b98b293f76451da648b15901c60e65c4

@githubvet githubvet added fresh no one has ever voted on this issue tiny less than 10 lines of code labels Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fresh no one has ever voted on this issue tiny less than 10 lines of code
Projects
None yet
Development

No branches or pull requests

1 participant