Skip to content

Commit

Permalink
Release 1.8.1 [5693] (#574)
Browse files Browse the repository at this point in the history
* Refs #5496 Reordering code to avoid data race on StatefulWriter destructor. (#546)

* Fix lroundl error on Windows. [5505] (#549)

* Refs #5313 Fix lroundl error on Windows.

* Refs #5505 Sugested changes

* Refs #5505 Removed unnecessary parenthesis and clang warnings.

* Adds tests for ReaderHistory [5503] (#547)

* Refs #5486. First tests for ReaderHistory

GetRepeatedSequenceNumber test will fail until the bug is fixed

* Refs #5486. Added more tests for ReaderHistory

GetChange test will fail until the bug is fixed

Also fixed a bug in ReaderHistory::remove_changes_with_guid function. The comparison between writerGUIDs was wrong. operator == is used instead.

* Refs #5486. Fixed memory leaks

* Refs #5486. Fixed Windows warnings

* Refs #5486. Code Style

* Refs #5486. Fixed Mac Warning

* Refs #5486. Fixed Mac Warning

* Refs #5486. Removed set_reader function from ReaderHistory. Added new constructor to the StatefulReader mock instead.

* Refs #5486. Added default constructors

* Refs #5486. Removed code needed

* Refs #5486. Fix error in RTPSReader mock (security did not pass)

* Fixing data race on UDPTransportInterface [5458] (#540)

* Refs #5458. Fixing data race on UDPTransportInterface.

* Refs #5458. Fixing timeouts on Mac.

* Refs #5458 Fixing data race on ReceiverResource dtor.

* Refs #5458 Clang-tidy warnings

* Refs #5458 Fixing Mac timeout.

* Refs #5458 Fixing valgrind invalid read.

* Refs #5458 Requested changes.

* Refs #5458 Fixing situation when socket doesn't close nicely.

* Refs #5458 Trying to fix Mac issue.

* Refs #5458 Trying to fix Mac issue.

* Refs #5458 Trying to fix Mac issue.

* Refs #5458 Fixed Mac issue.

* Refs #5458 Avoid loop when multicast. Much lesser wait time until continue.

* Refs #5458 Requested changes.

* Tests for CacheChangePool [5599] (#557)

* Refs #5551. First tests for CacheChangePool

* Ignoring files for Eclipse and Visual Studio Code

* Refs #5551. Tests for reserve_Cache function

* Refs #5551. Improved tests for reserve_Cache function. Deleted CacheChangePoolAttributes, it uses a tuple and the Combine method instead.

* Refs #5551. Added two more tests for CacheChangePool
Checks the initialized status of a reserved cache_changed
Checks the size of allChanges and freeChanges vectors

* Refs #5552. Blackbox run with prealloc memory mode only

* Refs #5552. Fixed certificate xml files and regenerated smime files
Also fixed bug in BlackboxTestsPersistence. Byte for Prealloc Memory Mode is '3'

* Refs #5551. Fixed gtest comparisons between signed and unsigned types
Replaced EXPECT with ASSERT

* Refs #5551. Fixed Instanciation tests for Mac

* Added discovery regression test [5479] (#542)

* Refs #5453 Adding a test for discovery with thirty participants

* Refs #5453 Updating the test to check for matched readers/writers

* Refs #5453. Added test for multiple participants with multiple topics.

* Refs #5479. Fixing warnings on Mac.

* Refs #5479. Changed test to fail by timeout pattern.

* Refs #5479. Taking removal and unmatching into account.

* Refs #5479. Styling and no copy.

* Refs #5479. Fixing valgrind.

* Refs #5479. Avoiding possible port collisions.

* Refs #5479. Removing debug print methods.

* Refs #5479. Adding debug messages to persistence tests.

* Refs #5479. Closing participants.

* Refs #5479. Adding more info to persistence tests.

* Refs #5479. Fix build errors after rebase.

* Refs #4579. Addressing review comments.

* Log error when default profiles xml loads with error + unittest [5596] (#556)

* Log error when default profiles xml loads with error + unittest

* More verbose error

* log opening error also when the file is DEFAULT_FASTRTPS_PROFILES

* combine xml loading and error checking

* Using java 1.8 [5705] (#567)

* Refs #5693. Updating idl and fastcdr submodules

* Refs #5697. Targetting java 1.8

* Refs #5697. Adding linter options.

* Refs #5697. Fixing warnings.

* Do not print the error if the filename is the default (#568)

* Refs #5746: delete the periodic HB after stopping reader proxies (#572)

* Fix closing multicast UDP channel with whitelist [5732] (#569)

* Refs #5714. Added unit test.

* Refs #3463. On releasing UDP resources, if the closing of the UDP fails 10 times, shut it down manually.

* Refactor without sending close message

* Refs #5714 remove UDPTransportInterface::ReleaseInputChannel

* Wait until the UDPChannelResource::perform_listen_operation has joined before deleting the channel resource

* Refs #5714 Simplify channel resource release mechanism. Eliminates condition variable and mutex

* Adds liveliness QoS [5621] (#560)

* Refs #5183 Adding C++ example of liveliness with one AUTOMATIC publisher

* Refs #5183 Extending C++ examples to allow using a participant with two publishers

* Refs #5183 Extending C++ example to allow configuration of liveliness kind

* Refs #5060 Format changes only

* Refs #5060 Removing WriterProxyLiveliness and adding new classes

* Refs #5060 Adding liveliness manager to RTPSReader and WLP

* Refs #5060 Removing liveliness information from WriterProxyData

* Refs 5060 Adding functionality to liveliness manager + unit tests

* Refs #5060 Adding liveliness methods at the reader-writer layer

* Refs #5060 Updating WLP so that it invokes writer listener when liveliness of writer is lost

* Refs #5060 Adding callbacks to pub-sub layer

* Refs #5060 Implementing getters for liveliness status

* Refs #5060 Changes to implement assert_liveliness() method

* Refs #5060 Adding option to liveliness manager to exclude automatic writers

* Refs #5060 Fixing WLP so that liveliness manager is created when WLP is initialized

* Refs #5060 Fixing WLP so that liveliness manager is created when WLP is initialized. Also liveliness is not changeable

* Refs #5060 Changes to WLP to make AUTOMATIC (writer) - AUTOMATIC (reader) work

* Refs #5060 Changes to WLP to make MANUAL_BY_PARTICIPANT (w) - MANUAL_BY_PARTICIPANT (r) work

* Refs #5060 Changes to WLP to make MANUAL_BY_TOPIC (w) - MANUAL_BY_TOPIC (r) work

* Refs #5060 Changes to stateless reader and writer

* Refs #5060 Implementing assert_liveliness method

* Refs #5060 Changes to allow different liveliness kinds between writer/reader

* Refs #5060 Combining some blackbox tests

* Refs #5060 Code clean-up

* Refs #5060 Testing more than one pub/sub in the same participant

* Refs #5060 Code clean up

* Refs #5060 Fixing deadlock

* Refs #5060 More code clean up

* Refs #5060 Trying to fix builds

* Refs #5060 Trying to fix build of tests

* Refs #5060 Fixing error message that shouldn't be logged

* Refs #5060 Fixing warnings and trying to make tests for stable when running valgrind

* Refs #5060 Addressing review comments

* Refs #5060 Adding a python test for automatic liveliness

* Refs #5058 Fixing windows builds

* Refs #5060 Fixing mac warnings

* Refs #5060 Fixing mac build

* Refs #5060 Fixing failing test on mac

* Refs #5060 Trying to make some tests more stable when using valgrind

* Refs #5060 Trying to make tests more stable by using condition variables

* Refs #5060 Resolving remaining review comments

* Refs #5060 Making some tests more stable on windows

* Refs #5060 Fixing remaining tabs

* Refs #5060 Fixing mac warning

* Refs #5060 Making some ests more stable on mac

* Refs #5060 Trying to fix remaining test that is failing on mac

* Refs #5060 Removing asserts and letting timers manage non-positive intervals

* Refs #5060 Adding explanation about non-positive intervals

* Refs #5693. Bump version to 1.8.1

* Refs #5761 Fixing liveliness manager tests that would fail with GTEST_INDIVIDUAL OFF (#577)

* Fix for liveliness changed struct (#578)

* Refs #5765 Adding a test

* Refs #5765 Fix for liveliness changed status

* Refs #5765 Adding more tests

* Refs #5765 Addressing some review comments

* Refs #5765 Adding indentation

* Adding assert_liveliness to participant (#579)
  • Loading branch information
MiguelCompany authored and raquelalvarezbanos committed Jun 28, 2019
1 parent 21c295e commit 0835a86
Show file tree
Hide file tree
Showing 151 changed files with 8,286 additions and 1,930 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Session.vim
.netrwhist
*~

### VisualStudio Code ###
*.vscode

### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
Expand Down Expand Up @@ -433,7 +435,11 @@ target/
# Eclipse
.cproject
.project
.settings

.pydevproject

compile_commands.json

# Visual Studio Code
.vscode
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
m4_define([version_major],[1])
m4_define([version_minor],[8])
m4_define([version_micro],[0])
m4_define([version_micro],[1])

AC_INIT([fastrtps], [version_major.version_minor.version_micro], [[email protected]], [eProsima FastRTPS], [http://eprosima.com/])
CONFIG_ARGS="$*"
Expand Down
51 changes: 51 additions & 0 deletions examples/C++/LivelinessQoS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 2.8.12)

if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0048 NEW)
endif()

project(LivelinessQoS)

# Find requirements
if(NOT fastcdr_FOUND)
find_package(fastcdr REQUIRED)
endif()

if(NOT fastrtps_FOUND)
find_package(fastrtps REQUIRED)
endif()

# Set C++11
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11)
if(SUPPORTS_CXX11)
add_compile_options(-std=c++11)
else()
message(FATAL_ERROR "Compiler doesn't support C++11")
endif()
endif()

message(STATUS "Configuring HelloWorld example...")
file(GLOB LIVELINESSQOS_SOURCES_CXX "*.cxx")
file(GLOB LIVELINESSQOS_SOURCES_CPP "*.cpp")

add_executable(LivelinessQoS ${LIVELINESSQOS_SOURCES_CXX} ${LIVELINESSQOS_SOURCES_CPP})
target_link_libraries(LivelinessQoS fastrtps fastcdr)
install(TARGETS LivelinessQoS
RUNTIME DESTINATION examples/C++/LivelinessQoS/${BIN_INSTALL_DIR})
145 changes: 145 additions & 0 deletions examples/C++/LivelinessQoS/LivelinessPublisher.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @file LivelinessPublisher.cpp
*
*/

#include "LivelinessPublisher.h"
#include <fastrtps/participant/Participant.h>
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/PublisherAttributes.h>
#include <fastrtps/publisher/Publisher.h>
#include <fastrtps/Domain.h>
#include <fastrtps/utils/eClock.h>

#include <thread>

using namespace eprosima::fastrtps;
using namespace eprosima::fastrtps::rtps;

LivelinessPublisher::LivelinessPublisher()
: participant_(nullptr)
, publisher_(nullptr)
{
}

bool LivelinessPublisher::init(
LivelinessQosPolicyKind kind,
int liveliness_ms)
{
topic_.index(0);
topic_.message("HelloWorld");

ParticipantAttributes PParam;
PParam.rtps.builtin.use_SIMPLE_RTPSParticipantDiscoveryProtocol = true;
PParam.rtps.builtin.use_SIMPLE_EndpointDiscoveryProtocol = true;
PParam.rtps.builtin.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true;
PParam.rtps.builtin.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true;
PParam.rtps.builtin.domainId = 0;
PParam.rtps.builtin.use_WriterLivelinessProtocol = true;
PParam.rtps.setName("Participant_pub");
participant_ = Domain::createParticipant(PParam);
if(participant_==nullptr)
{
return false;
}
Domain::registerType(participant_,&type_);

PublisherAttributes Wparam;
Wparam.topic.topicKind = NO_KEY;
Wparam.topic.topicDataType = "Topic";
Wparam.topic.topicName = "Name";
Wparam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS;
Wparam.topic.historyQos.kind = KEEP_LAST_HISTORY_QOS;
Wparam.topic.historyQos.depth = 30;
Wparam.qos.m_liveliness.lease_duration = Duration_t(liveliness_ms * 1e-3);
Wparam.qos.m_liveliness.announcement_period = Duration_t(liveliness_ms * 1e-3 * 0.5);
Wparam.qos.m_liveliness.kind = kind;
publisher_ = Domain::createPublisher(participant_, Wparam, &listener_);
if(publisher_ == nullptr)
{
return false;
}
return true;
}

LivelinessPublisher::~LivelinessPublisher()
{
Domain::removeParticipant(participant_);
}

void LivelinessPublisher::PubListener::onPublicationMatched(Publisher* /*pub*/,MatchingInfo& info)
{
if(info.status == MATCHED_MATCHING)
{
n_matched++;
first_connected = true;
std::cout << "Publisher matched" << std::endl;
}
else
{
n_matched--;
std::cout << "Publisher unmatched" << std::endl;
}
}

void LivelinessPublisher::PubListener::on_liveliness_lost(
Publisher *pub,
const LivelinessLostStatus &status)
{
std::cout << "Publisher " << pub->getGuid() << " lost liveliness: " << status.total_count << std::endl;
}

void LivelinessPublisher::run(uint32_t samples, uint32_t sleep)
{
std::thread thread1(&LivelinessPublisher::runThread, this, publisher_, samples, sleep);
thread1.join();
}

void LivelinessPublisher::runThread(
Publisher* pub,
uint32_t samples,
uint32_t sleep)
{

for(uint32_t i = 0;i<samples;++i)
{
if(!publish(pub))
{
--i;
}
else
{
std::cout << "Message with index: " << topic_.index()<< " SENT by publisher " << pub->getGuid() << std::endl;
}
eClock::my_sleep(sleep);
}

std::cin.ignore();
}

bool LivelinessPublisher::publish(
Publisher* pub,
bool waitForListener)
{
if(listener_.first_connected || !waitForListener || listener_.n_matched > 0)
{
topic_.index(topic_.index()+1);
pub->write((void*)&topic_);
return true;
}
return false;
}
94 changes: 94 additions & 0 deletions examples/C++/LivelinessQoS/LivelinessPublisher.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @file LivelinessPublisher.h
*
*/

#ifndef LivelinessPublisher_H_
#define LivelinessPublisher_H_

#include "TopicType.h"
#include "Topic.h"

#include <fastrtps/fastrtps_fwd.h>
#include <fastrtps/attributes/PublisherAttributes.h>
#include <fastrtps/publisher/PublisherListener.h>

#include <mutex>

class LivelinessPublisher {
public:

//! Constructor
LivelinessPublisher();

//! Destructor
virtual ~LivelinessPublisher();

//! Initialize
bool init(
eprosima::fastrtps::LivelinessQosPolicyKind kind,
int liveliness_ms);

//! Publish a sample
bool publish(
eprosima::fastrtps::Publisher* pub,
bool waitForListener = true);

//! Run for number samples
void run(uint32_t number, uint32_t sleep);

private:

Topic topic_;
TopicType type_;

eprosima::fastrtps::Participant* participant_;
eprosima::fastrtps::Publisher* publisher_;

class PubListener : public eprosima::fastrtps::PublisherListener
{
public:
PubListener()
: n_matched(0)
, first_connected(false)
{}

~PubListener()
{}

void onPublicationMatched(
eprosima::fastrtps::Publisher* pub,
eprosima::fastrtps::rtps::MatchingInfo& info) override;

void on_liveliness_lost(
eprosima::fastrtps::Publisher* pub,
const eprosima::fastrtps::LivelinessLostStatus& status) override;

int n_matched;
bool first_connected;
};
PubListener listener_;

void runThread(
eprosima::fastrtps::Publisher *pub,
uint32_t number,
uint32_t sleep);
};



#endif /* LivelinessPublisher_H_ */
Loading

0 comments on commit 0835a86

Please sign in to comment.