Skip to content

wsk activation pollSince should be more than activation start #459

@chetanmeh

Description

@chetanmeh

With #396 the activation poll internal pollSince time was set to activation start time. This ensured that pollSince moves forward with newer result.

However this changed set the pollSince to last activation.Start.

for _, activation := range activations {
if reported[activation.ActivationID] == true {
continue
} else {
fmt.Printf(
wski18n.T("\nActivation: '{{.name}}' ({{.id}})\n",
map[string]interface{}{"name": activation.Name, "id": activation.ActivationID}))
printJSON(activation.Logs)
reported[activation.ActivationID] = true
}
if activation.Start > pollSince {
pollSince = activation.Start
}
}
time.Sleep(time.Second * 2)
}

Hence the subsequent poll query would always fetch the last activation. This can be checked in server logs. Below logs are based on changes in apache/openwhisk#4688 and log the result size. As seen the result size remains 1. To fix this we should set the pollSince to last activations activation.Start + 1

[CosmosDBArtifactStore] [QUERY] 'activations' searching 'whisks.v2.1.0/activations' [marker:database_queryView_start:4]
[CosmosDBArtifactStore] [QUERY] 'activations' completed: matched 1 resultDelta=2791, sinceDelta=105631 [marker:database_queryView_finish:541:536]
GET /api/v1/namespaces/_/activations docs=true&limit=0&since=1571041261111&skip=0
[CosmosDBArtifactStore] [QUERY] 'activations' searching 'whisks.v2.1.0/activations' [marker:database_queryView_start:5]
[CosmosDBArtifactStore] [QUERY] 'activations' completed: matched 1 resultDelta=5267, sinceDelta=5267 [marker:database_queryView_finish:471:466]
GET /api/v1/namespaces/_/activations docs=true&limit=0&since=1571041261111&skip=0
[CosmosDBArtifactStore] [QUERY] 'activations' searching 'whisks.v2.1.0/activations' [marker:database_queryView_start:4]
[CosmosDBArtifactStore] [QUERY] 'activations' completed: matched 1 resultDelta=7741, sinceDelta=7741 [marker:database_queryView_finish:469:465]
GET /api/v1/namespaces/_/activations docs=true&limit=0&since=1571041261111&skip=0
[CosmosDBArtifactStore] [QUERY] 'activations' searching 'whisks.v2.1.0/activations' [marker:database_queryView_start:5]
[CosmosDBArtifactStore] [QUERY] 'activations' completed: matched 1 resultDelta=10219, sinceDelta=10219 [marker:database_queryView_finish:473:468]
GET /api/v1/namespaces/_/activations docs=true&limit=0&since=1571041261111&skip=0
[CosmosDBArtifactStore] [QUERY] 'activations' searching 'whisks.v2.1.0/activations' [marker:database_queryView_start:5]
[CosmosDBArtifactStore] [QUERY] 'activations' completed: matched 1 resultDelta=12695, sinceDelta=12695 [marker:database_queryView_finish:472:467]

This was found as part of work being done for apache/openwhisk#4684

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions