apache / openwhisk-cli

Apache OpenWhisk Command Line Interface (CLI)
https://openwhisk.apache.org/
Apache License 2.0
103 stars 99 forks source link

wsk activation pollSince should be more than activation start #459

Closed chetanmeh closed 5 years ago

chetanmeh commented 5 years ago

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.

https://github.com/apache/openwhisk-cli/blob/3669173ca7c69f5305b42260ba5c991d6a5694d6/commands/activation.go#L394-L409

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