Skip to content

MDEV-41080 startup code on Windows, remove checks for existing service - #5729

Merged
vaintroub merged 1 commit into
10.11from
10.11-MDEV-41080
Sep 22, 2026
Merged

vaintroub merged 1 commit into
10.11from
10.11-MDEV-41080

Conversation

@vaintroub

Copy link
Copy Markdown
Member

Summary

  • Remove the is_existing_service heuristic; always attempt StartServiceCtrlDispatcher and fall back to running as a normal process if that fails
  • Report unexpected errors from StartServiceCtrlDispatcher/RegisterServiceCtrlHandler to the Windows Event Log
  • Use the authoritative service name returned as the first argument to svc_main by the Service Control Manager, instead of guessing it from the command line

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The service dispatch table can prevent installed services from starting correctly.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates Windows startup handling to use SCM dispatching, report errors, and rely on SCM-provided service names.

Changes:

  • Removes service-existence heuristics.
  • Adds Event Log reporting for startup errors.
  • Uses the service name supplied by SCM.
File Summary
sql/​winmain.cc Critical issue: use NULL rather than an empty service name in the dispatch table. The file header also needs updating to reflect the new startup behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sql/winmain.cc

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

No-argument service invocations still bypass the service dispatcher and fail to connect to the SCM.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread sql/winmain.cc

@sanja-byelkin sanja-byelkin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove magic number if possible otherwise it is good (as far as I can check :) )

Comment thread sql/winmain.cc Outdated
@vaintroub
vaintroub force-pushed the 10.11-MDEV-41080 branch 2 times, most recently from c08dc5a to 9212d9c Compare September 22, 2026 12:08
They were not necessary, just try to run as service, and fallback to
command line.

Add some diagnostics - unexpected errors from StartServiceCtrlDispatcher
and RegisterServiceCtrlHandler are now reported to Windows event log.

Also use authoritative service name, returned as first argument
in svc_main by service control manager.
@vaintroub
vaintroub enabled auto-merge (rebase) September 22, 2026 13:03
@vaintroub
vaintroub merged commit a536798 into 10.11 Sep 22, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants