Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

lstocchi
Copy link
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
Collaborator Author

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

@cfergeau
Copy link
Collaborator

cfergeau commented Jan 8, 2025

The test failures should be fixed by fe7285a

Copy link
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
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
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
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 <[email protected]>
@cfergeau
Copy link
Collaborator

cfergeau commented Jan 8, 2025

/lgtm
/approve

Copy link
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

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

@openshift-merge-bot openshift-merge-bot bot merged commit 5f09250 into containers:main Jan 8, 2025
19 of 20 checks passed
@lstocchi lstocchi deleted the noELService branch January 8, 2025 13:45
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