GoogleCloudPlatform / guest-agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google_metadata_script_runner: last few seconds of logs are not flushed to Cloud Logging

rkolchmeyer opened this issue · comments

I noticed that the following startup-script:

#!/bin/bash
echo hello

does not upload any logs to Cloud Logging. I also noticed that the following startup-script:

#!/bin/bash
echo hello
sleep 10

does upload logs to Cloud Logging.

I've also noticed that more complicated startup scripts appear to be missing the last few lines of their log in Cloud Logging. It seems to me that the last few seconds of startup script logs are not uploaded to Cloud Logging. This is particularly problematic for startup scripts that are really fast.

I have not tested this but it seems like this is the issue. Logs are flushed every 5 seconds thus losing last few logs as process exits.