- Newest
- Most votes
- Most comments
Hi SimonManour,
we noticed a support ticket was opened for you for this issue. We have replied and will be tracking there.
To also update this thread, we have identified the root cause is that in no internet scenario put metric call, awssdk retries several times and sleeps in between retries resulting in lambda timeout for Cloudwatch which is 3 seconds. As a workaround you should be able to override the timeout by doing a new deployment increasing the timeoutInSeconds config parameter to 10-15 seconds here (https://us-west-2.console.aws.amazon.com/iot/home?region=us-west-2#/greengrass/v2/components/public/aws.greengrass.Cloudwatch/versions/2.0.7). This is a bug as there should not be any blocking code inside the function handler and we will be working on that.
Thank you,
zhaoylin
answered 5 years ago
To elaborate a bit more, the following error message gets posted inside the main 'greengrass.log'
2021-10-22T11:11:12.733Z \[ERROR] (pool-1-thread-3) com.aws.greengrass.lambdamanager.WorkManager: work-item-timeout. lambda work item timed out. {workItem=76bbb577-fe91-4fd4-a08c-35ea2cb7ab80, arn=arn:aws:lambda:eu-west-1:aws:function:aws-greengrass-cloudwatch:5}
2021-10-22T11:11:12.733Z \[ERROR] (pool-1-thread-3) com.aws.greengrass.lambdamanager.UserLambdaService: service-errored. {serviceInstance=0, serviceName=aws.greengrass.Cloudwatch, currentState=RUNNING}
com.aws.greengrass.lambdamanager.WorkItemTimeoutException: The work item with invocation id 76bbb577-fe91-4fd4-a08c-35ea2cb7ab80 has timed out, worker lambda arn: arn:aws:lambda:eu-west-1:aws:function:aws-greengrass-cloudwatch:5
at com.aws.greengrass.lambdamanager.WorkManager.lambda$getNextWork$12(WorkManager.java:332)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2021-10-22T11:11:12.733Z \[INFO] (pool-1-thread-3) com.aws.greengrass.lambdamanager.UserLambdaService: service-report-state. {serviceInstance=0, serviceName=aws.greengrass.Cloudwatch, currentState=RUNNING, newState=ERRORED}
2021-10-22T11:11:12.734Z \[INFO] (aws.greengrass.Cloudwatch-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=aws.greengrass.Cloudwatch, currentState=RUNNING, newState=BROKEN}
answered 5 years ago
Hello,
thank you for the provided information. So far, I can confirm that by updating Cloudwatch component to version 3.0.0 and using the configuration you have recommended, the service has indeed started to work as expected. The component does not get BROKEN when the network is disconnected, and properly re-establishes the connection as soon as the network is reachable again and stays RUNNING even after a prolonged period of network downtime.
Have a nice day,
Simon
answered 5 years ago
Relevant content
- AWS OFFICIALUpdated 2 years ago
