Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
This repository was 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

Description

@mkleina

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions