Skip to content

Warn user and keep executing if Event Log Service is stopped#442

Merged
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
lstocchi:noELService
Jan 8, 2025
Merged

Warn user and keep executing if Event Log Service is stopped#442
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
lstocchi:noELService

Conversation

@lstocchi
Copy link
Copy Markdown
Collaborator

As reported by containers/podman#21426 , it may happen that during a Windows update the Event Log Service is disabled automatically without the user noticing it. In this case win-sshproxy fails at starting bc it is not able to write logs.

However, the Event Log Service could also be disabled voluntarely by the user and we cannot be sure that the user want/can re-enable it.

With this patch, when the Event Log Service is not running, a warn log is printed and win-sshproxy keeps executing.
It should be up to the user to decide if to start the Event Log service again or keep running win-sshproxy without logs.

@lstocchi
Copy link
Copy Markdown
Collaborator Author

cc @baude this is related to containers/podman#21426

@cfergeau
Copy link
Copy Markdown
Collaborator

cfergeau commented Jan 8, 2025

The test failures should be fixed by fe7285a

Copy link
Copy Markdown
Collaborator

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
The handling of the debug flag is done in `setupLogging' after opening the event log, I don't know if this should be done unconditionally even if we could not open the event log, or if we keep the code as it currently is.

log, err := setupLogging(args[0])
if err != nil {
os.Exit(1)
if sysErr, isSysErr := err.(syscall.Errno); isSysErr && sysErr == RPC_S_SERVER_UNAVAILABLE {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this use https://pkg.go.dev/errors#Is to make this code simpler?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated 👍

@openshift-ci openshift-ci bot added the approved label Jan 8, 2025
@lstocchi
Copy link
Copy Markdown
Collaborator Author

lstocchi commented Jan 8, 2025

Looks good to me. The handling of the debug flag is done in `setupLogging' after opening the event log, I don't know if this should be done unconditionally even if we could not open the event log, or if we keep the code as it currently is.

The fact is that if the event log service is disabled no logs will be written either if there is the debug flag or not. So i don't think it makes any difference.

As reported by containers/podman#21426 , it
may happen that during a Windows update the Event Log Service is
disabled automatically without the user noticing it. In this case win-sshproxy
fails at starting bc it is not able to write logs.

However, the Event Log Service could also be disabled voluntarely by the
user and we cannot be sure that the user want/can re-enable it. In such a case,
a warn log is printed and win-sshproxy keeps executing. It
should be up to the user to decide if to start the Event Log service again or keep
running win-sshproxy without logs.

Signed-off-by: lstocchi <lstocchi@redhat.com>
@cfergeau
Copy link
Copy Markdown
Collaborator

cfergeau commented Jan 8, 2025

/lgtm
/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau, lstocchi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants