To better support heartbeat responses it is necessary to
allow RTS messages to be sent prior to the loading of
the initial route table. This change implements this and
has the side effect of also allowing wormhold sends prior
to a route table arrival (which is ok since no routing
is needed for wormhole traffic).
Issue-ID: RIC-589
Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: I302bdd0f274a7c5bc95f3f382e3374b21662ab8c
# API and build change and fix summaries. Doc correctsions
# and/or changes are not mentioned here; see the commit messages.
# API and build change and fix summaries. Doc correctsions
# and/or changes are not mentioned here; see the commit messages.
+2020 July 9; version 4.1.3
+ Allow RTS messages to be sent before the arrival of the initial
+ route table. Calls to RTS (heart beat responses) prior to the
+ initial route table load could cause a crash if a framework
+ blindly assumes that RTS is valid. (RIC-589)
+
2020 June 22; version 4.1.2
Fix typo in RIC Message header file.
2020 June 22; version 4.1.2
Fix typo in RIC Message header file.
set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "1" )
set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "1" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
included with the RMR development package while subscription
IDs are generated by the subscription manager process at
run-time. This document does not include the constant values
included with the RMR development package while subscription
IDs are generated by the subscription manager process at
run-time. This document does not include the constant values
-to avoid incorrectly propigating a stale value through the
+to avoid incorrectly propagating a stale value through the
reference of an outdated document.
reference of an outdated document.
version 4.0.0, the RMR versions should no longer skip.
version 4.0.0, the RMR versions should no longer skip.
+2020 July 9; version 4.1.3
+--------------------------
+
+Allow RTS messages to be sent before the arrival of the
+initial route table. Calls to RTS (heart beat responses)
+prior to the initial route table load could cause a crash if
+a framework blindly assumes that RTS is valid. (RIC-589)
+
+
+
2020 June 22; version 4.1.2
---------------------------
2020 June 22; version 4.1.2
---------------------------
}
send_rt_ack( pctx, mbuf, ctx->table_id, RMR_OK, NULL );
}
send_rt_ack( pctx, mbuf, ctx->table_id, RMR_OK, NULL );
+ ctx->rtable_ready = 1; // route based sends can now happen
} else {
if( DEBUG > 1 ) rmr_vlog_force( RMR_VL_DEBUG, "end of route table noticed, but one was not started!\n" );
ctx->new_rtable = NULL;
} else {
if( DEBUG > 1 ) rmr_vlog_force( RMR_VL_DEBUG, "end of route table noticed, but one was not started!\n" );
ctx->new_rtable = NULL;
int d1_len; // extra header data 1 length
int d2_len; // extra header data 2 length (future)
nng_socket nn_sock; // our general listen socket
int d1_len; // extra header data 1 length
int d2_len; // extra header data 2 length (future)
nng_socket nn_sock; // our general listen socket
+ int rmr_ready; // rmr table has been loaded/recived
route_table_t* rtable; // the active route table
route_table_t* old_rtable; // the previously used rt, sits here to allow for draining
route_table_t* new_rtable; // route table under construction
route_table_t* rtable; // the active route table
route_table_t* old_rtable; // the previously used rt, sits here to allow for draining
route_table_t* new_rtable; // route table under construction
+ ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // allows wormhole and rts calls to work before rt is received
if( flags & FL_NOTHREAD ) { // if no rtc thread, we still need an empty route table for wormholes
if( flags & FL_NOTHREAD ) { // if no rtc thread, we still need an empty route table for wormholes
- ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // so create one
+ ctx->rmr_ready = 1; // for a nothread instance, rmr is ready to go here
+ ctx->rmr_ready = o; // ensure not ready until static/dynamic table loaded
+
if( (tok = getenv( ENV_RTG_RAW )) != NULL && *tok == '0' ) { // use RMR for Rmgr comm only when specifically off
if( pthread_create( &ctx->rtc_th, NULL, rtc, (void *) ctx ) ) { // kick the rmr based rt collector thread
rmr_vlog( RMR_VL_WARN, "rmr_init: unable to start route table collector thread: %s", strerror( errno ) );
if( (tok = getenv( ENV_RTG_RAW )) != NULL && *tok == '0' ) { // use RMR for Rmgr comm only when specifically off
if( pthread_create( &ctx->rtc_th, NULL, rtc, (void *) ctx ) ) { // kick the rmr based rt collector thread
rmr_vlog( RMR_VL_WARN, "rmr_init: unable to start route table collector thread: %s", strerror( errno ) );
- if( ctx->rtable != NULL ) {
- return TRUE;
- }
-
- return FALSE;
int d1_len; // extra header data 1 length
int d2_len; // extra header data 2 length (future)
int nn_sock; // our general listen socket
int d1_len; // extra header data 1 length
int d2_len; // extra header data 2 length (future)
int nn_sock; // our general listen socket
+ int rtable_ready; // set to true when rt is received or loaded
route_table_t* rtable; // the active route table
route_table_t* old_rtable; // the previously used rt, sits here to allow for draining
route_table_t* new_rtable; // route table under construction
route_table_t* rtable; // the active route table
route_table_t* old_rtable; // the previously used rt, sits here to allow for draining
route_table_t* new_rtable; // route table under construction
// finish all flag setting before threads to keep helgrind quiet
ctx->flags |= CFL_MTC_ENABLED; // for SI threaded receiver is the only way
// finish all flag setting before threads to keep helgrind quiet
ctx->flags |= CFL_MTC_ENABLED; // for SI threaded receiver is the only way
- if( flags & RMRFL_NOTHREAD ) { // thread set to off; no route table collector started (could be called by the rtc thread itself)
- ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // creates an empty route table so that wormholes still can be used
+ ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // create an empty route table so that wormhole/rts calls can be used
+ if( flags & RMRFL_NOTHREAD ) { // no thread prevents the collector start for very special cases
+ ctx->rtable_ready = 1; // route based sends will always fail, but rmr is ready for the non thread case
+ ctx->rtable_ready = 0; // no sends until a real route table is loaded in the rtc thread
+
if( static_rtc ) {
rmr_vlog( RMR_VL_INFO, "rmr_init: file based route table only for context on port %s\n", uproto_port );
if( pthread_create( &ctx->rtc_th, NULL, rtc_file, (void *) ctx ) ) { // kick the rt collector thread as just file reader
if( static_rtc ) {
rmr_vlog( RMR_VL_INFO, "rmr_init: file based route table only for context on port %s\n", uproto_port );
if( pthread_create( &ctx->rtc_th, NULL, rtc_file, (void *) ctx ) ) { // kick the rt collector thread as just file reader
- if( ctx->rtable != NULL ) {
- return TRUE;
- }
-
- return FALSE;
+ return ctx->rtable_ready;