Skip to content

Conversation

@gregns1
Copy link
Contributor

@gregns1 gregns1 commented Nov 18, 2025

CBG-4981

  • Have a nil check around sg replicate manager before attempting to fetch replications

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

Copilot AI review requested due to automatic review settings November 18, 2025 13:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a panic in the _config?include_runtime=true endpoint (CBG-4981) that occurs when the SGReplicateMgr is nil. This can happen when a database fails to complete its online startup process, leaving certain components uninitialized.

Key changes:

  • Added a nil check before accessing database.SGReplicateMgr in the config endpoint handler
  • Added a regression test that simulates a failed database startup and verifies the endpoint doesn't panic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rest/admin_api.go Added nil check for SGReplicateMgr before fetching replications to prevent panic
rest/api_test.go Added regression test that creates a database with invalid config, triggers failed startup, and verifies the config endpoint works without panicking

@gregns1 gregns1 merged commit 27f3016 into main Nov 19, 2025
42 checks passed
@gregns1 gregns1 deleted the CBG-4981 branch November 19, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants