Fix: bogus sm logs falsely complain service enable timeout

This fix service enabling timeout timer incorrect left active after service is
enabled.
Also ensure properly transitioning to service enabling state from enabling-throttle
state (transition logging).

Closes-Bug: 1931617
Signed-off-by: Bin Qian <bin.qian@windriver.com>
Change-Id: I0be01c335ef9e39d1f14df12cccdf97ce09fbb5c
This commit is contained in:
Bin Qian 2021-06-10 15:35:53 -04:00
parent 9fefc6ef53
commit 0288e26cca
2 changed files with 8 additions and 7 deletions

View File

@ -82,7 +82,8 @@ static bool sm_service_enabling_state_timeout_timer( SmTimerIdT timer_id,
DPRINTFI( "Service (%s) enabling overall timeout.", service->name );
return( true );
// don't need to rearm
return( false );
}
// ****************************************************************************

View File

@ -52,13 +52,14 @@ static bool sm_service_enabling_throttle_state_timeout_timer( SmTimerIdT timer_i
if ( goahead )
{
error = sm_service_fsm_set_state( service,
SM_SERVICE_STATE_ENABLING );
error = sm_service_fsm_event_handler( service->name,
SM_SERVICE_EVENT_ENABLE,
NULL, "throttle open to enable service" );
if( SM_OKAY != error )
{
DPRINTFE( "Set state (%s) of service (%s) failed, error=%s.",
sm_service_state_str( SM_SERVICE_STATE_ENABLING ),
service->name, sm_error_str( error ) );
DPRINTFE( "Failed to signal enable service "
"(%s), error=%s.", service->name, sm_error_str( error ) );
// retry next time
return true;
}
@ -70,7 +71,6 @@ static bool sm_service_enabling_throttle_state_timeout_timer( SmTimerIdT timer_i
}
// set to enabling state, timer is no more needed
service->action_state_timer_id = SM_TIMER_ID_INVALID;
return( false );
}
// ****************************************************************************