Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Dec 21, 2022

Description

This fixes a bug in SunshineSvc where it would not properly inform the Service Control Manager when startup failed. Without a call to SetServiceStatus(), SCM will just keep waiting for us until a system-wide service start timeout expires, even though we returned from ServiceMain(). The actual error that led us to fail startup will be lost and never logged.

With this change, we properly report errors back to SCM during startup, so net start and the Event Log will correctly display the failure and the error code.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@cgutman cgutman force-pushed the sunshinesvc_hang_fix branch from f926923 to f8235fc Compare December 21, 2022 15:48
If we just return from ServiceMain() without updating our status, SCM will think we hung.
@ReenigneArcher ReenigneArcher merged commit 8a99187 into LizardByte:nightly Dec 21, 2022
KuleRucket pushed a commit to KuleRucket/Sunshine that referenced this pull request Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants