Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

snaptel task watch command in Snap version 1.1.0 hangs #1521

Closed
mkleina opened this issue Feb 15, 2017 · 2 comments · Fixed by #1537
Closed

snaptel task watch command in Snap version 1.1.0 hangs #1521

mkleina opened this issue Feb 15, 2017 · 2 comments · Fixed by #1537

Comments

@mkleina
Copy link
Contributor

mkleina commented Feb 15, 2017

There is issue with task watching from command line in Snap version 1.1.0 release and current master (85079bc). Snap CLI stops updating task watch data and snaptel process starts to consume 100% CPU after some time, until Ctrl-C.

Issue was mentioned here: intelsdi-x/snap-plugin-collector-cpu#50
I checked it for several different collector plugins and issue still exists, so it is not plugin-related issue.

It seems that for some reason, the timeout setting stops whole watching process and then snapctl goes into some infinite loop. For example, snaptel --timeout 15s stops responding exactly after 15 seconds.

Workaround

Hopefully, there is workaround that can be applied very quickly. Standard Go HTTP client Timeout value set to 0 means infinite timeout, checked it and

snaptel --timeout 0s <Task ID>

does not hang at all. To implement this workaround ti is needed to modify snap/cmd/snaptel/flags.go:

flTimeout = cli.DurationFlag{
	Name:  "timeout, t",
	Usage: "Timeout to be set on HTTP request to the server",
	Value: 10 * time.Second,
}

and change default timeout value of 10 seconds to zero.

@mkleina
Copy link
Contributor Author

mkleina commented Feb 15, 2017

@jcooklin

@jcooklin
Copy link
Collaborator

Good catch @mkleina.

IRCody pushed a commit to IRCody/snap that referenced this issue Feb 27, 2017
Removes the timeout from the rest client when using task watch. Because
the timeout isn't reset on each transfer of data having a timeout
causes the watch to eventually hang when set.
IRCody pushed a commit to IRCody/snap that referenced this issue Feb 28, 2017
Removes the timeout from the rest client when using task watch. Because
the timeout isn't reset on each transfer of data having a timeout
causes the watch to eventually hang when set.
IRCody added a commit that referenced this issue Mar 1, 2017
Fixes #1521: Snaptel hang on task watch
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants