Commit 0e3c33bd authored by gmarek's avatar gmarek

log_size_monitor shouldn't fail test in case of error

parent e5d4663d
......@@ -196,7 +196,7 @@ func (g *LogSizeGatherer) Run() {
// Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine,
// gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into
// the queue with a <pollingPeriod> delay.
// the queue with a <pollingPeriod> delay. Returns false if worker should exit.
func (g *LogSizeGatherer) Work() bool {
var workItem WorkItem
select {
......@@ -210,14 +210,21 @@ func (g *LogSizeGatherer) Work() bool {
workItem.ip,
testContext.Provider,
)
expectNoError(err)
if err != nil {
Logf("Error while trying to SSH to %v, skipping probe.", workItem.ip)
g.workChannel <- workItem
return true
}
results := strings.Split(sshResult.Stdout, " ")
now := time.Now()
for i := 0; i+1 < len(results); i = i + 2 {
path := results[i]
size, err := strconv.Atoi(results[i+1])
expectNoError(err)
if err != nil {
Logf("Error during conversion to int: %v, skipping data", results[i+1])
continue
}
g.data.AddNewData(workItem.ip, path, now, size)
}
go func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment