When using the rmr_realloc_payload() function with the copy
flag set, it was possible to copy a short length of data,
or none at all. This change corrects the miscomputed length
to copy.
Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: I01a98fa66ab69d5f11a792463bc04b73209f098b
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.
+2019 November 14; version 1.11.1
+ Fix bug in payload reallocation function; correct length of payload
+ was not always copied.
+
+2019 November 4; version 1.11.0
+ Version bump to move away from the 1.10.* to distinguish between
+ release A and the trial.
+
2019 October 31; version 1.10.2
Provide the means to increase the payload size of a received message
without losing the data needed to use the rmr_rts_msg() funciton.
2019 October 31; version 1.10.2
Provide the means to increase the payload size of a received message
without losing the data needed to use the rmr_rts_msg() funciton.
Correct application level test issue causing timing problems during
jenkins verification testing at command and merge
Correct application level test issue causing timing problems during
jenkins verification testing at command and merge
- Handle the NNG connection shutdown status which may now be
+ Handle the NNG connection shutdown status which may now be
generated when a connection throug a proxy is reset.
2019 September 25; version 1.8.2
generated when a connection throug a proxy is reset.
2019 September 25; version 1.8.2
2019 September 19; version 1.8.1
Correct missing constant for wrappers.
2019 September 19; version 1.8.1
Correct missing constant for wrappers.
2019 September 19; version 1.8.0
New message types added:
RAN_CONNECTED, RAN_RESTARTED, RAN_RECONFIGURED
2019 September 19; version 1.8.0
New message types added:
RAN_CONNECTED, RAN_RESTARTED, RAN_RECONFIGURED
the sender. If this environment variable is not present, the host
name (original behaviour) is used.
the sender. If this environment variable is not present, the host
name (original behaviour) is used.
-2019 August 26; version 1.4.0
+2019 August 26; version 1.4.0
New message types were added.
2019 August 16; version 1.3.0
New message types were added.
2019 August 16; version 1.3.0
that the transport mechanism might set during send and/or
receive operations. C programmes should continue to use
errno directly, but in some environments wrappers may not be
that the transport mechanism might set during send and/or
receive operations. C programmes should continue to use
errno directly, but in some environments wrappers may not be
- able to access errno and this provides the value to them.
+ able to access errno and this provides the value to them.
See the rmr_alloc_msg manual page for more details.
See the rmr_alloc_msg manual page for more details.
2019 August 6; version 1.0.45 (build changes)
Support for the Nanomsg transport library has been dropped.
The library librmr.* will no longer be included in packages.
2019 August 6; version 1.0.45 (build changes)
Support for the Nanomsg transport library has been dropped.
The library librmr.* will no longer be included in packages.
set( major_version "1" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "11" )
set( major_version "1" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "11" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
completely up to date listing of API changes.
completely up to date listing of API changes.
+2019 November 14; version 1.11.1
+--------------------------------------------------------------------------------------------
+
+Fix bug in payload reallocation function; correct length of
+payload was not always copied.
+
+
+2019 November 4; version 1.11.0
+--------------------------------------------------------------------------------------------
+
+Version bump to move away from the 1.10.* to distinguish
+between release A and the trial.
+
+
2019 October 31; version 1.10.2
--------------------------------------------------------------------------------------------
2019 October 31; version 1.10.2
--------------------------------------------------------------------------------------------
Correct missing constant for wrappers.
Correct missing constant for wrappers.
2019 September 19; version 1.8.0
--------------------------------------------------------------------------------------------
2019 September 19; version 1.8.0
--------------------------------------------------------------------------------------------
to access errno and this provides the value to them. See the
rmr_alloc_msg manual page for more details.
to access errno and this provides the value to them. See the
rmr_alloc_msg manual page for more details.
2019 August 6; version 1.0.45 (build changes)
--------------------------------------------------------------------------------------------
2019 August 6; version 1.0.45 (build changes)
--------------------------------------------------------------------------------------------
if( copy ) { // if we need to copy the old payload too
if( DEBUG ) fprintf( stderr, "[DBUG] rmr_realloc_payload: copy payload into new message: %d bytes\n", old_psize );
if( copy ) { // if we need to copy the old payload too
if( DEBUG ) fprintf( stderr, "[DBUG] rmr_realloc_payload: copy payload into new message: %d bytes\n", old_psize );
- memcpy( nm->header, omhdr, sizeof( char ) * old_psize );
+ memcpy( nm->header, omhdr, sizeof( char ) * (old_psize + RMR_HDR_LEN( omhdr )) );
} else { // just need to copy header
if( DEBUG ) fprintf( stderr, "[DBUG] rmr_realloc_payload: copy only header into new message: %d bytes\n", RMR_HDR_LEN( nm->header ) );
} else { // just need to copy header
if( DEBUG ) fprintf( stderr, "[DBUG] rmr_realloc_payload: copy only header into new message: %d bytes\n", RMR_HDR_LEN( nm->header ) );
- memcpy( nm->header, omhdr, sizeof( char ) * RMR_HDR_LEN( nm->header ) );
+ memcpy( nm->header, omhdr, sizeof( char ) * RMR_HDR_LEN( omhdr ) );
}
ref_tpbuf( nm, mlen ); // set payload and other pointers in the message to the new tp buffer
}
ref_tpbuf( nm, mlen ); // set payload and other pointers in the message to the new tp buffer
if( ack_count < 1 ) { // 1st ack, so we need to connect, and we'll wait for that
sleep( 1 );
}
if( ack_count < 1 ) { // 1st ack, so we need to connect, and we'll wait for that
sleep( 1 );
}
+ if( rt_count > 5 ) { // but only pause for max 5sec not 1000s!
+ rt_count = 5;
+ }
rt_count--;
msg = rmr_rts_msg( mrc, msg ); // we don't try to resend if this returns retry
}
rt_count--;
msg = rmr_rts_msg( mrc, msg ); // we don't try to resend if this returns retry
}
git pull # get the up to date code so if run from an old image it's a good test
fi
cd $build_path
git pull # get the up to date code so if run from an old image it's a good test
fi
cd $build_path
make package
) >/tmp/PID$$.log
if (( $? != 0 ))
make package
) >/tmp/PID$$.log
if (( $? != 0 ))
while( rt_count > 0 && msg != NULL && msg->state == RMR_ERR_RETRY ) { // to work right in nano we need this :(
if( ack_count < 1 ) { // 1st ack, so we need to connect, and we'll wait for that
sleep( 1 );
while( rt_count > 0 && msg != NULL && msg->state == RMR_ERR_RETRY ) { // to work right in nano we need this :(
if( ack_count < 1 ) { // 1st ack, so we need to connect, and we'll wait for that
sleep( 1 );
+ if( rt_count > 5 ) {
+ rt_count = 5; // but only for 5sec; not 1000sec!
+ }
}
rt_count--;
msg = rmr_rts_msg( mrc, msg ); // we don't try to resend if this returns retry
}
rt_count--;
msg = rmr_rts_msg( mrc, msg ); // we don't try to resend if this returns retry
+
+ timeout = time( NULL ) + 10; // extend timeout to 10s past last received message
run_test run_rr_test.ksh
echo "----- rts -------------------"
run_test run_rr_test.ksh
echo "----- rts -------------------"
-run_test run_rts_test.ksh -s 20
+run_test run_rts_test.ksh -s 5 -d 100
echo "----- extended payload ------"
run_test run_exrts_test.ksh -d 10 -n 1000
echo "----- extended payload ------"
run_test run_exrts_test.ksh -d 10 -n 1000
sbuf = rmr_send_msg( mrc, sbuf ); // retry send until it's good (simple test; real programmes should do better)
}
if( sbuf->state == RMR_OK ) {
sbuf = rmr_send_msg( mrc, sbuf ); // retry send until it's good (simple test; real programmes should do better)
}
if( sbuf->state == RMR_OK ) {
+ if( successful == 0 ) {
+ fail_count = 0; // count only after first message goes through
+ }
successful = 1; // indicates only that we sent one successful message, not the current state
} else {
successful = 1; // indicates only that we sent one successful message, not the current state
} else {
- if( successful ) {
- fail_count++; // count failures after first successful message
+ fail_count++; // count failures after first successful message
+ if( !successful && fail_count > 30 ) {
+ fprintf( stderr, "[FAIL] too many send errors for this test\n" );
+ exit( 1 );
- timeout = time( NULL ) + 2; // allow 2 seconds for the pipe to drain from the receiver
- while( time( NULL ) < timeout );
+ fprintf( stderr, "<SNDR> draining begins\n" );
+ timeout = time( NULL ) + 20; // allow 20 seconds for the pipe to drain from the receiver
+ while( time( NULL ) < timeout ) {
if( rcv_fd >= 0 ) {
while( (nready = epoll_wait( ep_fd, events, 1, 100 )) > 0 ) { // if something ready to receive (non-blocking check)
if( events[0].data.fd == rcv_fd ) { // we only are waiting on 1 thing, so [0] is ok
if( rcv_fd >= 0 ) {
while( (nready = epoll_wait( ep_fd, events, 1, 100 )) > 0 ) { // if something ready to receive (non-blocking check)
if( events[0].data.fd == rcv_fd ) { // we only are waiting on 1 thing, so [0] is ok
if( rbuf ) {
rcvd_count++;
rts_ok += vet_received( me, rbuf->payload );
if( rbuf ) {
rcvd_count++;
rts_ok += vet_received( me, rbuf->payload );
- timeout = time( NULL ) + 2;
+ timeout = time( NULL ) + 10; // break 10s after last received message
+ }
+ fprintf( stderr, "<SNDR> draining finishes\n" );
if( rcvd_count != rts_ok || count != nmsgs ) {
pass = 0;
if( rcvd_count != rts_ok || count != nmsgs ) {
pass = 0;
sbuf = rmr_send_msg( mrc, sbuf ); // retry send until it's good (simple test; real programmes should do better)
}
if( sbuf->state == RMR_OK ) {
sbuf = rmr_send_msg( mrc, sbuf ); // retry send until it's good (simple test; real programmes should do better)
}
if( sbuf->state == RMR_OK ) {
+ if( successful == 0 ) {
+ fail_count = 0; // reset on first good message out
+ }
successful = 1; // indicates only that we sent one successful message, not the current state
} else {
successful = 1; // indicates only that we sent one successful message, not the current state
} else {
- if( successful ) {
- fail_count++; // count failures after first successful message
- }
- if( fail_count > 10 ) {
- fprintf( stderr, "too many failures\n" );
+ fail_count++; // count failures after first successful message
+ if( ! successful && fail_count > 10 ) {
+ fprintf( stderr, "[FAIL] too many send failures\n" );
- timeout = time( NULL ) + 2; // allow 2 seconds for the pipe to drain from the receiver
+ timeout = time( NULL ) + 20; // allow 20 seconds for the pipe to drain from the receiver
while( time( NULL ) < timeout ) {
if( rcv_fd >= 0 ) {
while( (nready = epoll_wait( ep_fd, events, 1, 100 )) > 0 ) {
while( time( NULL ) < timeout ) {
if( rcv_fd >= 0 ) {
while( (nready = epoll_wait( ep_fd, events, 1, 100 )) > 0 ) {
rts_ok += validate_msg( rbuf->payload, rbuf->len );
}
rts_ok += validate_msg( rbuf->payload, rbuf->len );
}
- timeout = time( NULL ) + 2;
+ timeout = time( NULL ) + 10;
}
if( rcvd_count != rts_ok || count != nmsgs ) { // we might not receive all back if receiver didn't retry, so that is NOT a failure here
}
if( rcvd_count != rts_ok || count != nmsgs ) { // we might not receive all back if receiver didn't retry, so that is NOT a failure here
+ fprintf( stderr, "<VSNDR> rcvd=%d rts_ok=%d count=%d nmsg=%d\n", rcvd_count, rts_ok, count, nmsgs );