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

Test Making RTPS the Default for the Future #2454

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions DDS.mwc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ workspace {
// Run tools/modeling/tests/setup.pl to generate
// tools/modeling/tests/modeling_tests.mwc.
tools/modeling/tests

dds/InfoRepo
tools/dcpsinfo_dump
}
}
3 changes: 3 additions & 0 deletions DDS_TAOv2.mwc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ workspace {
// Run tools/modeling/tests/setup.pl to generate
// tools/modeling/tests/modeling_tests.mwc.
tools/modeling/tests

dds/InfoRepo
tools/dcpsinfo_dump
}
}
4 changes: 2 additions & 2 deletions DevGuideExamples/DCPS/Messenger.minimal/MessengerMinimal.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(*idl): dcps {
custom_only = 1
}

project(*publisher) : dcpsexe, dcps_tcp, dds_model {
project(*publisher) : dcps, dcps_rtps_udp, dds_model {
requires += no_opendds_safety_profile
exename = publisher
after += *idl
Expand All @@ -22,7 +22,7 @@ project(*publisher) : dcpsexe, dcps_tcp, dds_model {
}
}

project(*subscriber) : dcpsexe, dcps_tcp, dds_model {
project(*subscriber) : dcps, dcps_rtps_udp, dds_model {
requires += no_opendds_safety_profile
exename = subscriber
after += *publisher
Expand Down
25 changes: 0 additions & 25 deletions DevGuideExamples/DCPS/Messenger.minimal/run_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,9 @@
my $sub_opts = "$common_opts -DCPSTransportDebugLevel 6 " .
"-ORBLogFile subscriber.log";

my $dcpsrepo_ior = "repo.ior";

unlink $dcpsrepo_ior;

my $DCPSREPO = PerlDDS::create_process ("$ENV{DDS_ROOT}/bin/DCPSInfoRepo",
"-ORBDebugLevel 10 " .
"-ORBLogFile DCPSInfoRepo.log " .
"-o $dcpsrepo_ior");

my $Subscriber = PerlDDS::create_process ("subscriber", " $sub_opts");
my $Publisher = PerlDDS::create_process ("publisher", " $pub_opts");

print $DCPSREPO->CommandLine() . "\n";
$DCPSREPO->Spawn ();
if (PerlACE::waitforfile_timed ($dcpsrepo_ior, 30) == -1) {
print STDERR "ERROR: waiting for Info Repo IOR file\n";
$DCPSREPO->Kill ();
exit 1;
}

print $Publisher->CommandLine() . "\n";
$Publisher->Spawn ();

Expand All @@ -56,12 +39,4 @@
$status = 1;
}

my $ir = $DCPSREPO->TerminateWaitKill(5);
if ($ir != 0) {
print STDERR "ERROR: DCPSInfoRepo returned $ir\n";
$status = 1;
}

unlink $dcpsrepo_ior;

exit $status;
4 changes: 2 additions & 2 deletions DevGuideExamples/DCPS/Messenger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set(CMAKE_CXX_COMPILER ${OPENDDS_COMPILER})

set(opendds_libs
OpenDDS::Dcps # Core OpenDDS Library
OpenDDS::InfoRepoDiscovery OpenDDS::Tcp # For run_test.pl
OpenDDS::Rtps OpenDDS::Rtps_Udp # For run_test.pl --rtps
OpenDDS::Rtps OpenDDS::Rtps_Udp # For run_test.pl
OpenDDS::InfoRepoDiscovery # For run_test.pl --info-repo
)

# Publisher
Expand Down
4 changes: 2 additions & 2 deletions DevGuideExamples/DCPS/Messenger/Messenger.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(*idl): dcps {
custom_only = 1
}

project(*publisher) : dcpsexe, dcps_tcp, dcps_rtps_udp {
project(*publisher) : dcps, dcps_rtps_udp, dcps_inforepodiscovery {
requires += no_opendds_safety_profile
exename = publisher
after += *idl
Expand All @@ -21,7 +21,7 @@ project(*publisher) : dcpsexe, dcps_tcp, dcps_rtps_udp {
}
}

project(*subscriber) : dcpsexe, dcps_tcp, dcps_rtps_udp {
project(*subscriber) : dcps, dcps_rtps_udp, dcps_inforepodiscovery {
requires += no_opendds_safety_profile
exename = subscriber
after += *publisher
Expand Down
9 changes: 4 additions & 5 deletions DevGuideExamples/DCPS/Messenger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ A very basic OpenDDS example, covered in the OpenDDS Developer's Guide.

If you just want to build and run this, it will be built along with OpenDDS and
can be run using `perl run_test.pl` assuming the `setenv` file has been sourced
(see [INSTALL.md](../../../INSTALL.md) for details). To have it use the DDS
standard RTPS discovery and transport instead of the OpenDDS specific InfoRepo
discovery and TCP transports, run `perl run_test.pl --rtps` instead.
(see [INSTALL.md](../../../INSTALL.md) for details). To have it use the
OpenDDS-specific InfoRepo discovery instead of the DDS standard RTPS discovery,
run `perl run_test.pl --info-repo` instead.

## CMake

Expand All @@ -23,5 +23,4 @@ these are the recommend steps:
"out-of-source" build.
- Run `cmake ..` to generate the build and `cmake --build .` to build.
- To run the example you can copy `run_test.pl` to the `build` directory and
use that or run `./publisher -DCPSConfigFile ../rtps.ini` and `./subscriber
-DCPSConfigFile ../rtps.ini` at the same time.
use that or run `./publisher` and `./subscriber` at the same time.
2 changes: 2 additions & 0 deletions DevGuideExamples/DCPS/Messenger/info-repo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[common]
DCPSDefaultDiscovery=DEFAULT_REPO
6 changes: 0 additions & 6 deletions DevGuideExamples/DCPS/Messenger/rtps.ini

This file was deleted.

14 changes: 7 additions & 7 deletions DevGuideExamples/DCPS/Messenger/run_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

my $status = 0;

my $rtps = 0;
my $info_repo = 0;
my $help = 0;

my $help_message = "usage: run_test.pl [-h|--help] [--rtps]\n";
my $help_message = "usage: run_test.pl [-h|--help] [--info-repo]\n";
if (not GetOptions(
"rtps" => \$rtps,
"info-repo" => \$info_repo,
"help|h" => \$help
)) {
print STDERR ("Invalid Command Line Argument(s)\n$help_message");
Expand All @@ -36,8 +36,8 @@

my $common_opts = "-ORBDebugLevel 10 -DCPSDebugLevel 10";

if ($rtps) {
$common_opts .= " -DCPSConfigFile rtps.ini";
if ($info_repo) {
$common_opts .= " -DCPSConfigFile info-repo.ini";
}

my $pub_opts = "$common_opts -ORBLogFile publisher.log";
Expand All @@ -64,7 +64,7 @@
my $Subscriber = PerlDDS::create_process("subscriber", " $sub_opts");
my $Publisher = PerlDDS::create_process("publisher", " $pub_opts");

if (not $rtps) {
if ($info_repo) {
unlink $dcpsrepo_ior;

$DCPSREPO = PerlDDS::create_process(
Expand Down Expand Up @@ -100,7 +100,7 @@
$status = 1;
}

if (not $rtps) {
if ($info_repo) {
my $ir = $DCPSREPO->TerminateWaitKill(5);
if ($ir != 0) {
print STDERR "ERROR: DCPSInfoRepo returned $ir\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project(*idl): dcps_test_idl_only_lib {
}
}

project(*publisher) : dcpsexe, dcps_tcp {
project(*publisher) : dcps_rtps_udp {
requires += no_opendds_safety_profile
exename = publisher
after += *idl
Expand All @@ -24,7 +24,7 @@ project(*publisher) : dcpsexe, dcps_tcp {
}
}

project(*subscriber) : dcpsexe, dcps_tcp {
project(*subscriber) : dcps_rtps_udp {
requires += no_opendds_safety_profile
exename = subscriber
after += *idl
Expand Down
25 changes: 0 additions & 25 deletions DevGuideExamples/DCPS/Messenger_ZeroCopy/run_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,9 @@
my $sub_opts = "$common_opts -DCPSTransportDebugLevel 6 " .
"-ORBLogFile subscriber.log";

my $dcpsrepo_ior = "repo.ior";

unlink $dcpsrepo_ior;

my $DCPSREPO = PerlDDS::create_process ("$ENV{DDS_ROOT}/bin/DCPSInfoRepo",
"$common_opts " .
"-ORBLogFile DCPSInfoRepo.log " .
"-o $dcpsrepo_ior ");

my $Subscriber = PerlDDS::create_process ("subscriber", " $sub_opts");
my $Publisher = PerlDDS::create_process ("publisher", " $pub_opts");

print $DCPSREPO->CommandLine() . "\n";
$DCPSREPO->Spawn ();
if (PerlACE::waitforfile_timed ($dcpsrepo_ior, 30) == -1) {
print STDERR "ERROR: waiting for Info Repo IOR file\n";
$DCPSREPO->Kill ();
exit 1;
}

print $Publisher->CommandLine() . "\n";
$Publisher->Spawn ();

Expand All @@ -56,12 +39,4 @@
$status = 1;
}

my $ir = $DCPSREPO->TerminateWaitKill(5);
if ($ir != 0) {
print STDERR "ERROR: DCPSInfoRepo returned $ir\n";
$status = 1;
}

unlink $dcpsrepo_ior;

exit $status;
5 changes: 1 addition & 4 deletions MPC/config/dcps_default_discovery.mpb
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
feature(!no_opendds_safety_profile) : dcps_rtps {
}

feature(no_opendds_safety_profile) : dcps_inforepodiscovery, dcps_tcp {
project: dcps_rtps {
}
2 changes: 1 addition & 1 deletion bin/PerlDDS/Run_Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ sub new {
$self->{info_repo}->{file} = "repo.ior";
$self->{processes}->{process} = {};
$self->{processes}->{order} = [];
$self->{discovery} = "info_repo";
$self->{discovery} = "rtps";
$self->{test_verbose} = 0;
$self->{add_transport_config} = 1;
$self->{nobits} = 0;
Expand Down
9 changes: 1 addition & 8 deletions dds/DCPS/Service_Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ static bool got_pending_timeout = false;
static bool got_persistent_data_dir = false;
#endif
static bool got_default_discovery = false;
#ifndef DDS_DEFAULT_DISCOVERY_METHOD
# ifdef OPENDDS_SAFETY_PROFILE
# define DDS_DEFAULT_DISCOVERY_METHOD Discovery::DEFAULT_RTPS
# else
# define DDS_DEFAULT_DISCOVERY_METHOD Discovery::DEFAULT_REPO
# endif
#endif
static bool got_log_fname = false;
static bool got_log_verbose = false;
static bool got_default_address = false;
Expand All @@ -170,7 +163,7 @@ Service_Participant::Service_Participant()
ORB_argv_(false /*substitute_env_args*/),
#endif
reactor_task_(false),
defaultDiscovery_(DDS_DEFAULT_DISCOVERY_METHOD),
defaultDiscovery_(Discovery::DEFAULT_RTPS),
n_chunks_(DEFAULT_NUM_CHUNKS),
association_chunk_multiplier_(DEFAULT_CHUNK_MULTIPLIER),
liveliness_factor_(80),
Expand Down
9 changes: 1 addition & 8 deletions dds/DCPS/transport/framework/TransportRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ namespace {
{
return lhs->name() < rhs->name();
}

// transport type to try loading if none are loaded when DCPS attempts to use
#ifdef OPENDDS_SAFETY_PROFILE
const char FALLBACK_TYPE[] = "rtps_udp";
#else
const char FALLBACK_TYPE[] = "tcp";
#endif
}

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
Expand Down Expand Up @@ -714,7 +707,7 @@ TransportRegistry::fix_empty_default()
}
TransportConfig_rch global_config = global_config_;
#if !defined(ACE_AS_STATIC_LIBS)
load_transport_lib_i(FALLBACK_TYPE);
load_transport_lib_i("rtps_udp");
#endif
return global_config;
}
Expand Down
5 changes: 0 additions & 5 deletions dds/DCPS/transport/rtps_udp/RtpsUdpLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,12 @@ void RtpsUdpLoader::load()
}

registry->register_type(type);
// Don't create a default for RTPS. At least for the initial implementation,
// the user needs to explicitly configure it...
#ifdef OPENDDS_SAFETY_PROFILE
// ...except for Safety Profile where RTPS is the only option.
TransportInst_rch default_inst =
registry->create_inst(TransportRegistry::DEFAULT_INST_PREFIX +
OPENDDS_STRING("0600_RTPS_UDP"),
RTPS_UDP_NAME, false);
registry->get_config(TransportRegistry::DEFAULT_CONFIG_NAME)
->sorted_insert(default_inst);
#endif
}

ACE_FACTORY_DEFINE(OpenDDS_Rtps_Udp, RtpsUdpLoader);
Expand Down
3 changes: 3 additions & 0 deletions dds/InfoRepo/DCPSInfoRepoServ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ InfoRepo::init()
CORBA::String_var objref_str =
orb_->object_to_string(info_repo);

// RTPS discovery is the default, change it to InfoRepo
TheServiceParticipant->set_default_discovery(OpenDDS::DCPS::Discovery::DEFAULT_REPO);

// Initialize the DomainParticipantFactory
DDS::DomainParticipantFactory_var dpf =
TheParticipantFactoryWithArgs(argc, args.argv());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ project(*SyncServer) : taoexe, portableserver, iortable, coverage_optional, dds_
}
}

project(*Publisher) : dcpsexe, dcps_test, dcps_tcp {
project(*Publisher) : dcps_test, dcps_inforepodiscovery, dcps_tcp {
requires += no_opendds_safety_profile
exename = publisher
libs += SyncClient
Expand All @@ -50,7 +50,7 @@ project(*Publisher) : dcpsexe, dcps_test, dcps_tcp {
}
}

project(*Subscriber) : dcpsexe, dcps_test, dcps_tcp {
project(*Subscriber) : dcps_test, dcps_inforepodiscovery, dcps_tcp {
requires += no_opendds_safety_profile
exename = subscriber
libs += SyncClient
Expand Down
1 change: 1 addition & 0 deletions performance-tests/DCPS/InfoRepo_population/pub.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[common]
DCPSDefaultDiscovery=DEFAULT_REPO
DCPSDebugLevel=0
DCPSInfoRepo=file://repo.ior
DCPSChunks=20
Expand Down
1 change: 1 addition & 0 deletions performance-tests/DCPS/InfoRepo_population/sub.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[common]
DCPSDefaultDiscovery=DEFAULT_REPO
DCPSDebugLevel=0
DCPSInfoRepo=file://repo.ior
DCPSChunks=20
Expand Down
2 changes: 2 additions & 0 deletions tests/DCPS/BuiltInTopicTest/info_repo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[common]
DCPSDefaultDiscovery=DEFAULT_REPO
1 change: 1 addition & 0 deletions tests/DCPS/BuiltInTopicTest/prst_repo_run_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
. " -o $dcpsrepo_ior"
. " -ORBSvcConf mySvc.conf"
. " -orbendpoint iiop://$orb_address:$SRV_PORT"
. " -DCPSConfigFile info_repo.ini"
;

my $repo1_log = 'repo1.log';
Expand Down
2 changes: 1 addition & 1 deletion tests/DCPS/DCPSInfoRepo/dcpsinfo_test.mpc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(*pubsub): dcpsexe, dcps_test, dcps_rtps_udp {
project(*pubsub): dcps_test, dcps_inforepodiscovery, dcps_rtps_udp {
requires += no_opendds_safety_profile
exename = pubsub
}
2 changes: 2 additions & 0 deletions tests/DCPS/DCPSInfoRepo/pubsub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
rtpsDisc->sedp_multicast(false);
disc = rtpsDisc;
} else {
TheServiceParticipant->set_default_discovery(OpenDDS::DCPS::Discovery::DEFAULT_REPO);

CORBA::Object_var tmp =
orb->string_to_object (ACE_TEXT_ALWAYS_CHAR(ior));
OpenDDS::DCPS::DCPSInfo_var info =
Expand Down