spinnaker-plugins / aws-lambda-deployment-plugin-spinnaker

Spinnaker plugin to support deployment of AWS Lambda functions via Spinnaker pipelines
Apache License 2.0
23 stars 22 forks source link

LambdaCacheRefreshTask does not seem to refresh the cache #48

Closed mikael-lindstrom closed 3 years ago

mikael-lindstrom commented 3 years ago

LambdaCacheRefreshTask does not seem to refresh the cache, this causes problems downstream if the AWS Lambda Deployment stage is followed by a AWS Lambda Route stage where the lookup for Newest version returns the old cached version.

Looking at the clouddriver logs I cannot see a on-demand cache refresh being triggered. I switched to calling clouddriver directly in this branch and added a cache refresh after publish. After this change I do see on-demand cache refresh being triggered in clouddriver logs. Not sure why cacheService.forceCacheUpdate does not trigger an update.

However it does not seem like the cache is refreshed in time for the AWS Lambda Publish in some cases, even with the 20s wait in LambdaCacheRefreshTask.

My current workaround is to add a LambdaWaitForCachePublishTask which simply waits until the published version is returned from clouddriver. The changes are available in this branch. This solves the problem for my usecase, I'd be happy to make a PR if my changes makes sense.

shyamsfo commented 3 years ago

Sure, send me a PR...

shyamsfo commented 3 years ago

Marking as closed after merging changes to master...