Skip to content

Conversation

@K3das
Copy link
Contributor

@K3das K3das commented Dec 27, 2025

closes #55 and makes progress on #56

Description

  • Adds context cancellation to decom and waits for decom channels to close before exiting gsw_service.
  • Makes influx configuration optional.
  • Expands the logger API to expose the underlying zap logger and improves the logging of gsw_service and the influx writer.

Tested by stopping gsw_service and ensuring no SHM descriptors are left.

fix: clean up gsw_service and db logging
@K3das K3das requested a review from Copilot December 27, 2025 02:56
@K3das K3das linked an issue Dec 27, 2025 that may be closed by this pull request
Copy link

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 enhances the shutdown behavior of the GSW service to ensure proper cleanup of shared memory (SHM) writers. It introduces context-based cancellation to the decom subsystem and expands the logger API to expose the underlying zap logger for improved structured logging.

Key changes:

  • Added context cancellation support to TelemetryPacketWriter to enable graceful shutdown
  • Exposed the underlying zap logger through a new Log() function in the logger API
  • Improved structured logging throughout decom and database writer components

Reviewed changes

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

File Description
proc/decom.go Refactored TelemetryPacketWriter to accept context, return errors, and use structured logging with proper UDP connection cleanup
lib/logger/logger.go Added Log() function to expose the underlying zap logger for creating scoped loggers
cmd/gsw_service.go Updated to use context-aware decom initialization, wait for channel closure on shutdown, and made database configuration optional
proc/db_write.go Enhanced logging with scoped logger and structured fields for the database writer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@K3das K3das marked this pull request as ready for review December 27, 2025 03:06
@K3das K3das requested a review from AarC10 December 27, 2025 03:07
@K3das K3das merged commit 8ba934a into main Dec 29, 2025
2 checks passed
@K3das K3das deleted the fix/mia/clean-up-shm-writers branch December 29, 2025 06:58
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.

gsw_service doesn't clean up SHM writers

3 participants