Skip to content

Make improvements to DSRM code#204

Merged
gab-arrobo merged 1 commit intoomec-project:mainfrom
gab-arrobo:drsm-updates
Oct 27, 2025
Merged

Make improvements to DSRM code#204
gab-arrobo merged 1 commit intoomec-project:mainfrom
gab-arrobo:drsm-updates

Conversation

@gab-arrobo
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
@gab-arrobo gab-arrobo requested review from a team and Copilot October 27, 2025 22:08
Copy link
Copy Markdown

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 improves error handling and code quality in the DSRM (Distributed Shared Resource Manager) module. The changes focus on proper resource cleanup, error handling, and using modern Go idioms.

Key changes:

  • Added proper context cancellation to prevent resource leaks
  • Replaced panic calls with graceful error handling and logging
  • Improved map lookup patterns using the idiomatic two-value form
  • Modernized BSON document construction syntax

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

continue
}
var s streamDoc
bsonBytes, _ := bson.Marshal(data)
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

Error from bson.Marshal is being ignored. If marshaling fails, the subsequent Unmarshal will operate on nil/empty bytes and produce misleading errors. Add error handling: bsonBytes, err := bson.Marshal(data); if err != nil { logger.DrsmLog.Errorf(\"failed to marshal stream data: %v\", err); continue }

Copilot uses AI. Check for mistakes.
@gab-arrobo gab-arrobo merged commit 2d9bd28 into omec-project:main Oct 27, 2025
7 checks passed
@gab-arrobo gab-arrobo deleted the drsm-updates branch October 27, 2025 22:11
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