Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gNOI Cold Reboot - Integrated Rebootbackend changes #20710

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rkavitha-hcl
Copy link

Why I did it

Work item tracking
  • Microsoft ADO (number only):

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

  1. This PR has the code for reboot backend processing to handle Cold Reboot feature.
  2. Framework docker starts the rebootbackend process which receives notification from Redis when there is any gNOI request for Cold Reboot.
  3. It processes the request and updates the Reboot status flags and then notifies sonic-host-services to trigger the reboot thro' dbus interface.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@rkavitha-hcl rkavitha-hcl requested a review from lguohan as a code owner November 6, 2024 07:31
@qiluo-msft qiluo-msft requested review from hdwhdw and vvolam November 7, 2024 17:29
src/sonic-framework/rebootbackend/interfaces.h Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/interfaces.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/interfaces.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/reboot_common.h Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/redis_utils.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/redis_utils.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/redis_utils.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/redis_utils.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/rebootbe.h Show resolved Hide resolved
@rkavitha-hcl rkavitha-hcl force-pushed the gnoi_cr_PR2 branch 2 times, most recently from 5ac7797 to c4b69a6 Compare November 18, 2024 09:17
@hdwhdw hdwhdw self-requested a review November 20, 2024 16:21
Copy link

@hdwhdw hdwhdw left a comment

Choose a reason for hiding this comment

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

Generally OK. Just some nits.

src/sonic-framework/rebootbackend/reboot_common.cpp Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/reboot_common.h Outdated Show resolved Hide resolved
src/sonic-framework/rebootbackend/reboot_thread.cpp Outdated Show resolved Hide resolved
Comment on lines 161 to 193
void reboot_thread(void);
void do_reboot(void);
Progress send_dbus_reboot_request();
void do_cold_reboot(swss::Select &s);

// Inner loop select handler to wait for platform reboot.
// wait for timeout
// wait for a stop request (sigterm)
// Returns:
// EXIT_EARLY: an issue occurred that stops WARM
// PROCEED: if reboot timeout expired
Progress platform_reboot_select(swss::Select &s,
swss::SelectableTimer &l_timer);

// Wait for platform to reboot while waiting for possible stop
// Returns:
// EXIT_EARLY: an issue occurred that stops WARM
// PROCEED: if reboot timeout expired
Progress wait_for_platform_reboot(swss::Select &s);

// Log error string, set status to RebootStatus_Status_STATUS_FAILURE
// Set status message to error_string.
void log_error_and_set_non_retry_failure(const std::string error_string);

// Log error string, set status to
// RebootStatus_Status_STATUS_RETRIABLE_FAILURE Set status message to
// error_string.
void log_error_and_set_failure_as_retriable(const std::string error_string);


// Request is input only.
// Response is ouput only.
// Return true if preconditions met, false otherwise.
bool check_start_preconditions(const gnoi::system::RebootRequest &request,
NotificationResponse &response);
Copy link

Choose a reason for hiding this comment

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

Nits: suggest stay consistent by staying pascal case and only use snake case for getters and setters.

@hdwhdw hdwhdw requested a review from qiluo-msft November 22, 2024 16:36
@rkavitha-hcl rkavitha-hcl force-pushed the gnoi_cr_PR2 branch 3 times, most recently from 4b8a987 to 76fa407 Compare December 4, 2024 11:19
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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