fix(report,cluster): ensure the process continues when previous logs are unavailable#8992
Merged
gbartolini merged 1 commit intomainfrom Oct 30, 2025
Merged
fix(report,cluster): ensure the process continues when previous logs are unavailable#8992gbartolini merged 1 commit intomainfrom
gbartolini merged 1 commit intomainfrom
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
gbartolini
approved these changes
Oct 29, 2025
…ogs unavailable Fixed two bugs in the pod logs writer that caused log collection to fail: 1. When Previous option is enabled, sendLogsToWriter was attempting to fetch logs with Previous=true twice - once for previous logs and again for current logs. This caused failures when containers had never been restarted (no previous terminated container exists). Now it correctly fetches previous logs first (with error handling), then fetches current logs with Previous=false. 2. The Multiple method was incorrectly passing opts instead of containerOpts to sendLogsToWriter, causing the container name to not be set properly. These fixes ensure that: - Missing previous logs are handled gracefully without stopping execution - Current logs are always collected even if previous logs are unavailable - Each container's logs are fetched with the correct container name Fixes #8985 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
jbattiato
approved these changes
Oct 30, 2025
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 30, 2025
…unavailable (#8992) Fixes two issues in the pod logs writer that caused log collection to fail: 1. Incorrect handling of previous logs: when the `Previous` option was enabled, `sendLogsToWriter` attempted to fetch logs with `Previous=true` twice — once for the previous logs and again for the current logs. This failed when containers had never been restarted (no previous terminated container). The logic now correctly fetches previous logs first (with proper error handling) and then retrieves current logs with `Previous=false`. 2. Incorrect container options: the `Multiple` method was passing `opts` instead of `containerOpts` to `sendLogsToWriter`, resulting in missing container names in the log collection process. With these fixes: - Missing previous logs no longer stop the process. - Current logs are always collected, even if previous logs are unavailable. - Each container’s logs are fetched with the correct container name. Fixes #8985 Signed-off-by: Armando Ruocco armando.ruocco@enterprisedb.com (cherry picked from commit eef478d)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 30, 2025
…unavailable (#8992) Fixes two issues in the pod logs writer that caused log collection to fail: 1. Incorrect handling of previous logs: when the `Previous` option was enabled, `sendLogsToWriter` attempted to fetch logs with `Previous=true` twice — once for the previous logs and again for the current logs. This failed when containers had never been restarted (no previous terminated container). The logic now correctly fetches previous logs first (with proper error handling) and then retrieves current logs with `Previous=false`. 2. Incorrect container options: the `Multiple` method was passing `opts` instead of `containerOpts` to `sendLogsToWriter`, resulting in missing container names in the log collection process. With these fixes: - Missing previous logs no longer stop the process. - Current logs are always collected, even if previous logs are unavailable. - Each container’s logs are fetched with the correct container name. Fixes #8985 Signed-off-by: Armando Ruocco armando.ruocco@enterprisedb.com (cherry picked from commit eef478d)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 30, 2025
…unavailable (#8992) Fixes two issues in the pod logs writer that caused log collection to fail: 1. Incorrect handling of previous logs: when the `Previous` option was enabled, `sendLogsToWriter` attempted to fetch logs with `Previous=true` twice — once for the previous logs and again for the current logs. This failed when containers had never been restarted (no previous terminated container). The logic now correctly fetches previous logs first (with proper error handling) and then retrieves current logs with `Previous=false`. 2. Incorrect container options: the `Multiple` method was passing `opts` instead of `containerOpts` to `sendLogsToWriter`, resulting in missing container names in the log collection process. With these fixes: - Missing previous logs no longer stop the process. - Current logs are always collected, even if previous logs are unavailable. - Each container’s logs are fetched with the correct container name. Fixes #8985 Signed-off-by: Armando Ruocco armando.ruocco@enterprisedb.com (cherry picked from commit eef478d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed two bugs in the pod logs writer that caused log collection to fail:
When Previous option is enabled, sendLogsToWriter was attempting to fetch logs with Previous=true twice - once for previous logs and again for current logs. This caused failures when containers had never been restarted (no previous terminated container exists). Now it correctly fetches previous logs first (with error handling), then fetches current logs with Previous=false.
The Multiple method was incorrectly passing opts instead of containerOpts to sendLogsToWriter, causing the container name to not be set properly.
These fixes ensure that:
Fixes #8985