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

Expose seqnum via sampleinfo #1484

Open
wants to merge 213 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
32db3dc
fuzz: building fuzz_handshake with libprotobuf-mutator works
robertfemmer Mar 12, 2024
c2f1592
expose-seqnum-via-sampleinfo
TheFixer Dec 4, 2019
8507ad3
Use seqno_t as type for sequence numbers (which is defined as uint64_t)
TheFixer Nov 18, 2022
571f080
Removed seq_no from dds_sampleinfo_t and add sequence_number to ddsi_…
TheFixer Dec 21, 2022
467b500
Add .get_sequencenumber function to ddsi_serdata_ops interface, so th…
TheFixer Jan 23, 2023
80854d1
First attempt to add writer guid to serdata interface
TheFixer May 1, 2023
a14732e
Implement function dds_reader_store_historical_data() to deliver serd…
TheFixer Jun 1, 2023
1bfa3b8
Use lifespan set to DDSRT_MTIME_NEVER when adding historical serdata …
TheFixer Jul 7, 2023
1b0dbac
create cmake infrastructure for durability
TheFixer Sep 14, 2023
1839152
Add durability as a trace category and initialize durability when the…
TheFixer Oct 10, 2023
1e9ff01
Do send a nack if a gap for durable data i detected
TheFixer Oct 10, 2023
91d4174
Quorum implementation based on subscription matched for durable writers
TheFixer Oct 13, 2023
05be93c
quorum checking for durable writers
TheFixer Oct 16, 2023
76fde62
Use similar idl files for durable client as for durable server
TheFixer Oct 17, 2023
1cae5ab
Initialize quorum_reached variable correctly in case quorum threshold…
TheFixer Oct 20, 2023
8f31f59
Use dds_get_matched_subscriptions() in dc_check_quorum_reched() to de…
TheFixer Oct 20, 2023
aa2ab4c
fix sanitizer error due to double free
mvandenhoek Oct 24, 2023
9aa2603
Publish dc_request when a durable reader is created
TheFixer Nov 3, 2023
4a97e03
Make dc_requests transient-local and autodispose, and add the ability…
TheFixer Nov 7, 2023
341c95f
Add additional check on the length of topic names in dc_requests
TheFixer Nov 13, 2023
e792bf6
Rebase the expose-seqnum-via-sampleinfo on current master
TheFixer Nov 15, 2023
b829bc6
Implement receiving dc_response from a DS
TheFixer Nov 17, 2023
c057bfd
expose symbols when building with durable support, fix goto labels
mvandenhoek Nov 21, 2023
7fef779
Refactor administration of requests; requests are now organised per s…
TheFixer Dec 6, 2023
fa6d5bf
Add ability to receive responses from a ds
TheFixer Dec 11, 2023
f525e95
Deliver data beads per data set to a dc, and allow delivery of data b…
TheFixer Dec 14, 2023
9411e0c
Data delivery to local readers
TheFixer Dec 20, 2023
760656d
Encode the writer's autodispose setting in response beads
TheFixer Dec 30, 2023
d74ff57
Inject historical data as unregistered when the proxy writer is not (…
TheFixer Jan 2, 2024
2ff72c9
Fix crash when printing octet sequence, and improve printing of trunc…
TheFixer Jan 5, 2024
195a7d4
Add //CycloneDDS/Domain/Durability/Quorum configuration option to set…
TheFixer Feb 7, 2024
6fc6bc4
Add type_id to dc_request and dc_response
TheFixer Mar 18, 2024
174ee2e
Fix merge issues when rebasing on CycloneDDS master
TheFixer Mar 22, 2024
4e46317
Exclude test cases for transient and persistent profiles when there i…
TheFixer Mar 22, 2024
53a204f
Allow multipathing between PSMX and DDSI
eboasson Jan 29, 2024
648a898
remove deprecate warnings when using openssl v3 (#1826)
MarcelJordense Mar 25, 2024
6f5ce86
Drop support for OpenSSL pre-1.1.1
eboasson Mar 22, 2024
840c1ff
Add build-time option for TCP+TLS support
eboasson Mar 26, 2024
54ec204
Update CI platform selection
eboasson Mar 20, 2024
d22e750
Fix false pos on null deref in serdata_from_ser
eboasson Jul 18, 2023
91b446c
Minor changes for gcc analyzer
eboasson Jul 18, 2023
32f3139
GCC analyzer dislikes non-null arg as loop var
eboasson Mar 20, 2024
0f07fe7
Suppress some warnings in mcpp
eboasson Mar 21, 2024
1c073c1
Allow some warnings for gcc 13.0 and 13.1
eboasson Mar 21, 2024
dfdbaf1
Add -rpath to macOS idlc/xtests build flags
eboasson Mar 21, 2024
8a16a76
Add non-null, &c attributes to xmsg.h
eboasson Aug 10, 2023
69a7e8b
Delete UnicastResponseToSPDPMessages option
eboasson Oct 31, 2023
3991b45
Dump malformed packets to trace, optionally to log
eboasson Jan 29, 2024
ff00abe
Add support for optional members in dynsub
eboasson Feb 22, 2024
0118042
Fix race condition in security FSM unit test
eboasson Mar 26, 2024
fa9f1a7
Correctly initialize defaulted external sequence
eboasson Mar 28, 2024
085bd87
Test initializing defaulted external sequence
eboasson Mar 28, 2024
0bf9627
Always make idlc_generate available in install
eboasson Mar 28, 2024
8959074
basic harness working
robertfemmer Mar 29, 2024
d45d6eb
Don't set a quorum on writers created by a DS
TheFixer Mar 29, 2024
6541a50
Don't run security tests when durability is enabled (they don't go we…
TheFixer Mar 29, 2024
3937eba
Add reader guid to dc_request
TheFixer Apr 2, 2024
8c8727e
fuzz_handshake: handshake both ways working
robertfemmer Apr 3, 2024
4765392
qos_provider support (#1955)
Splinter1984 Apr 3, 2024
cb46d84
fuzz_handshake: now builds in the oss-fuzz docker container
robertfemmer Apr 3, 2024
44ca08e
Fix padding issue in authentication plugin
eboasson Apr 4, 2024
c82c223
First attempt to add CM interface to the idl
TheFixer Apr 4, 2024
8ebc89e
Merge branch 'master' into fuzz_handshake
robertfemmer Apr 5, 2024
186f3ef
Delete some left-over code
eboasson Apr 4, 2024
e63372e
Add systematic tests for QoS set and match logic
eboasson Apr 8, 2024
32fcbbb
Fix DDS_IGNORELOCAL_PARTICIPANT matching code
eboasson Apr 8, 2024
2fb85d1
data reader has no transport priority QoS
eboasson Apr 8, 2024
9461655
Default pub/sub QoS: presentation and ignore_local
eboasson Apr 9, 2024
95bd6ba
Check creating an entity with invalid QoS fails
eboasson Apr 9, 2024
ab64868
Check QoS changes are accepted/rejected as planned
eboasson Apr 9, 2024
826a070
dds_qset_entity_name should free old value if set
eboasson Apr 9, 2024
6498bf9
Add TOPIC_DATA to ddsi_default_qos_topic
eboasson Apr 10, 2024
ac3c750
Add EXPORT_ALL_SYMBOLS option to build system
eboasson Apr 11, 2024
31a4843
Add fuzzer for security deserializer (#1967)
robertfemmer Apr 12, 2024
08fe238
Merge branch 'master' into fuzz_handshake
robertfemmer Apr 12, 2024
64066d8
Fixes for deserializers in authentication plugin
eboasson Apr 15, 2024
2d0b3ec
Some extra scripting for dealing with fuzzers
eboasson Apr 15, 2024
2ad37f4
Fix handling of empty second copy of PropertySeq
eboasson Apr 16, 2024
b17c425
Initialize the ret variable to fix compiler warnings.
t0ny-peng Apr 17, 2024
63d7ce2
Merge commit 'refs/pull/1968/head' of https://github.com/eclipse-cycl…
eboasson Apr 22, 2024
4d5b6f3
Fix leading underscore handling in IDLC
eboasson Apr 24, 2024
64f9033
Fix size of AF_LINK address on BSD
eboasson Apr 16, 2024
6639902
Syntax check PSMX config string in core code
eboasson Apr 18, 2024
d52f544
Use hash of network config as Iceoryx locator
eboasson Apr 18, 2024
7c253ad
Fix building for Zephyr V3.6, QNX and other platforms that don't supp…
PatrickM-ZS Apr 26, 2024
460851a
Exported the ddsrt_getifaddrs and ddsrt_freeifaddrs symbols which are…
gmartin82 Apr 30, 2024
022ba7a
Fix handshake fuzzer build issue and memory leaks
eboasson Apr 25, 2024
369dc22
Refactor delivery requests: a delivery request is now done for a read…
TheFixer May 7, 2024
64f203c
Merge pull request #1968 from robertfemmer/fuzz_handshake
eboasson May 13, 2024
ff640ac
sysdef parser `b64` decoding support
Splinter1984 Apr 26, 2024
ea68c19
qos_provider history_kind validation remove
Splinter1984 Apr 26, 2024
24c9938
history qos sysdef_parser: ignore `depth` elem when kind is `ALL`
Splinter1984 May 3, 2024
2caad2d
Add missing ddsrt_mutex_lock in gcreq_queue_step
eboasson May 14, 2024
2f16244
Resolve build-time circular dependencies by making the durability cli…
mvandenhoek May 15, 2024
f292e0a
cdrstream test: do not overallocate extern string
eboasson May 15, 2024
d6bdcc1
ddsrt_init suppress gcc 14.1 infinite loop warning
eboasson May 15, 2024
9861c79
Help gcc 14.1 avoid false pos infinite recursion
eboasson May 15, 2024
ff67f4d
Fix Zephyr ipv4 multicast support
PatrickM-ZS May 17, 2024
bcec954
Improve create_participant/domain documentation
eboasson May 15, 2024
d315b88
b64_encode improvements for qos_provider tests
Splinter1984 May 28, 2024
e070ffc
sysdef_parser tsn mac addresses support
Splinter1984 May 28, 2024
12e1158
Support for IDL modules in XML parser
dpotman May 23, 2024
be0e64a
Fix bug in dds_request_loan_of_size
reicheratwork May 29, 2024
e46c533
Remove invalid curly brace in Zephyr support code
PatrickM-ZS Jun 4, 2024
e3de841
Bump CI platforms
eboasson Jun 11, 2024
7c85973
Merge pull request #3 from mvandenhoek/resolve_circular_dependencies_…
TheFixer Jun 11, 2024
e1e2811
Slightly improve dds_waitset_wait_impl() performance by avoinding to …
ivanpauno May 25, 2024
d0a2df1
Provide writer meta-data when storing loaned sample
dpotman Mar 11, 2024
5ed9500
Add user-defined log categories
dpotman Oct 26, 2023
0932697
Add create-participant-with-guid function
dpotman Nov 21, 2023
39a909e
Add create-endpoint-with-guid
dpotman Nov 29, 2023
21736ed
Add no-discovery flag
dpotman Dec 7, 2023
f709b82
Add ddsi_get_port_int to internal header
dpotman Dec 14, 2023
28e7f98
Add function to get type name
dpotman Jan 4, 2024
7cfb88f
Add output parameter to DDSI proxy endpoint create functions
dpotman Feb 5, 2024
5c2c8b5
Add output parameter to DDSI proxy participant create function
dpotman Feb 5, 2024
a95ec69
Some minor DDSI type-ref refactoring
dpotman Apr 8, 2024
9152aa4
Export a set of internal functions
dpotman Feb 6, 2024
4c98862
PSMX deliver samples for non-discovered writers
dpotman Mar 28, 2024
dc96465
Include internal API header is dds_participant
dpotman Apr 10, 2024
c62b471
Fix incorrect CU_ASSERTS in test utils
dpotman Apr 10, 2024
15b3a09
Export dds_entity_lock/unlock
dpotman Apr 11, 2024
a16a718
Check for sync delivery for filtered proxy writers
eboasson Jun 10, 2024
845ae76
Partial support for building on macOS Snow Leopard
eboasson Jun 10, 2024
6aeb7ca
Avoid IP_PKTINFO on Snow Leopard
eboasson Jun 10, 2024
dbba39b
Rename cdrstream parts from .part.c to .part.h
eboasson Jun 7, 2024
f1a2945
Fix trivial compilation issues on BE machines
eboasson Jun 7, 2024
48ac8f4
Fix CDR stream compilation issues on BE machines
eboasson Jun 7, 2024
c8659b2
Fix bool/int confusion in struct ddsi_config
eboasson Jun 10, 2024
77a2fd4
Fix IDLC 32/64-bit confusion for data repr
eboasson Jun 10, 2024
a964e66
Fix IDLC 8/32/64-bit confusion for array bounds
eboasson Jun 10, 2024
2c515a5
Fix type/descriptor mismatch in CDR tests
eboasson Jun 10, 2024
e88924d
CDR test needs to be consistent in endianness
eboasson Jun 10, 2024
f2f4894
Support key serialization test on big-endian hosts
eboasson Jun 10, 2024
2b8b86e
Fix reading of min/max annotation value in test
eboasson Jun 10, 2024
2951b14
Remove dead compile-time conditional
eboasson Jun 10, 2024
1deaa93
Fix ENABLE_IPV6/ENABLE_SOURCE_SPECIFIC_MULTICAST
eboasson Jun 10, 2024
d54189d
oneliner "hearing!" wait for proxypp to be deleted
eboasson Apr 19, 2024
3dea06d
Refactor ddsi_type_add_typeobj
eboasson Jun 14, 2024
e1853ef
Do not change type in typelib making key holder
eboasson Jun 14, 2024
34eef7e
Skip optionals completely when deserializing a key (#2040)
eboasson Jun 17, 2024
a27ebfd
dynsub example: also respond to DCPSSubscription
eboasson Jun 14, 2024
841cd25
dynsub example: fix printing of bitmasks
eboasson Jun 14, 2024
3adfa6c
dynsub example: also print the minimal typeobject
eboasson Jun 14, 2024
f0324c4
dynsub example: support for arrays
eboasson Jun 17, 2024
00c63c3
Export sysdef parser functions
dpotman Jun 17, 2024
d5b2a48
Trace reason for declaring types non-assignable
eboasson Jun 17, 2024
b52b407
UAF in tracing preemptive ACKNACK with security
eboasson Jun 18, 2024
8a2a7a9
Fix harmless typo in dynsub output
eboasson Jun 18, 2024
72b4f86
Use copy of type id in non-assignability reason
eboasson Jun 18, 2024
24c6e8c
Fix loop bounds validating struct without members
eboasson Jun 18, 2024
545f4cb
Type builder: keys from non-mutable base types
eboasson Jun 18, 2024
03b1b09
Fix serdata size in serdata_default_from_psmx
dpotman Jun 19, 2024
f24646b
Fixed memory leak in idl preprocessor (#2023)
reicheratwork Jun 19, 2024
0b81f87
Update ddsi_new_proxy_participant call in fuzzer
eboasson Jun 19, 2024
53ecfa4
Always have a NACK scheduled if data is missing
eboasson Jun 4, 2024
80a4c2c
Consistently set in_file to a malloc'd pointer
eboasson Jun 19, 2024
d7db65c
Fix ACKNACK event mishandling of AANR_SILENT_NACK (#2049)
eboasson Jun 20, 2024
ce7cf3d
check return value of `X509_digest`
poetinger Jul 1, 2024
f5e5d6c
Tests and fixes for PSMX interface
mvandenhoek Jul 15, 2024
5842d13
Implement wfhd
TheFixer Jul 22, 2024
3262baa
Delete broken alternative for thread sanitizer
eboasson Jul 1, 2024
e8120b2
Improve ddsrt_recvmsg interface
eboasson Jun 28, 2024
343d8a2
Turn off PACKET_DESTINATION_INFO for mingw-w64.
eboasson Jul 1, 2024
d917212
Fix error handling in serdata_default_from_psmx
dpotman Jul 23, 2024
f5ac68c
Fixes for support of qnx 8.0
ThijsSassen Aug 14, 2024
565fc6b
add option to set realtime priority to iceorix notification thread (l…
MarcelJordense Aug 21, 2024
9051f4d
Fix to make version check compatible with older qnx versions
ThijsSassen Aug 22, 2024
41b1abb
Fix "oneliner" durability_service specification
eboasson Aug 12, 2024
4de86ec
Add setting for controlling thread affinity
eboasson Aug 12, 2024
b53c54a
fix compilation issue on qnx
MarcelJordense Aug 22, 2024
4c0a3f0
expose-seqnum-via-sampleinfo
TheFixer Dec 4, 2019
dc33523
Use seqno_t as type for sequence numbers (which is defined as uint64_t)
TheFixer Nov 18, 2022
ae0dc84
Removed seq_no from dds_sampleinfo_t and add sequence_number to ddsi_…
TheFixer Dec 21, 2022
6ca7432
Add .get_sequencenumber function to ddsi_serdata_ops interface, so th…
TheFixer Jan 23, 2023
45a6636
First attempt to add writer guid to serdata interface
TheFixer May 1, 2023
5e19507
Implement function dds_reader_store_historical_data() to deliver serd…
TheFixer Jun 1, 2023
5484e8c
Use lifespan set to DDSRT_MTIME_NEVER when adding historical serdata …
TheFixer Jul 7, 2023
1e71cd8
create cmake infrastructure for durability
TheFixer Sep 14, 2023
2ffb659
Add durability as a trace category and initialize durability when the…
TheFixer Oct 10, 2023
45a1805
Do send a nack if a gap for durable data i detected
TheFixer Oct 10, 2023
839ef4b
Quorum implementation based on subscription matched for durable writers
TheFixer Oct 13, 2023
0297892
quorum checking for durable writers
TheFixer Oct 16, 2023
513c1d7
Use similar idl files for durable client as for durable server
TheFixer Oct 17, 2023
a4ffe3d
Initialize quorum_reached variable correctly in case quorum threshold…
TheFixer Oct 20, 2023
3b1ed77
Use dds_get_matched_subscriptions() in dc_check_quorum_reched() to de…
TheFixer Oct 20, 2023
7652c5a
fix sanitizer error due to double free
mvandenhoek Oct 24, 2023
12216fa
Publish dc_request when a durable reader is created
TheFixer Nov 3, 2023
7df91d9
Make dc_requests transient-local and autodispose, and add the ability…
TheFixer Nov 7, 2023
d35a1ed
Add additional check on the length of topic names in dc_requests
TheFixer Nov 13, 2023
2c4016a
Rebase the expose-seqnum-via-sampleinfo on current master
TheFixer Nov 15, 2023
6af4159
Implement receiving dc_response from a DS
TheFixer Nov 17, 2023
1f03cb5
expose symbols when building with durable support, fix goto labels
mvandenhoek Nov 21, 2023
e23e202
Refactor administration of requests; requests are now organised per s…
TheFixer Dec 6, 2023
a72343c
Add ability to receive responses from a ds
TheFixer Dec 11, 2023
c538a64
Deliver data beads per data set to a dc, and allow delivery of data b…
TheFixer Dec 14, 2023
7e6c1f8
Data delivery to local readers
TheFixer Dec 20, 2023
ff823ef
Encode the writer's autodispose setting in response beads
TheFixer Dec 30, 2023
4eae0d7
Inject historical data as unregistered when the proxy writer is not (…
TheFixer Jan 2, 2024
eb31716
Fix crash when printing octet sequence, and improve printing of trunc…
TheFixer Jan 5, 2024
30c1db1
Add //CycloneDDS/Domain/Durability/Quorum configuration option to set…
TheFixer Feb 7, 2024
28ec521
Add type_id to dc_request and dc_response
TheFixer Mar 18, 2024
353fad4
Fix merge issues when rebasing on CycloneDDS master
TheFixer Mar 22, 2024
f06a86b
Exclude test cases for transient and persistent profiles when there i…
TheFixer Mar 22, 2024
22d638b
Don't set a quorum on writers created by a DS
TheFixer Mar 29, 2024
d1af80e
Don't run security tests when durability is enabled (they don't go we…
TheFixer Mar 29, 2024
bc4e598
Add reader guid to dc_request
TheFixer Apr 2, 2024
f023417
First attempt to add CM interface to the idl
TheFixer Apr 4, 2024
c2899a9
Refactor delivery requests: a delivery request is now done for a read…
TheFixer May 7, 2024
c4e259e
Resolve build-time circular dependencies by making the durability cli…
mvandenhoek May 15, 2024
6bd3816
Implement wfhd
TheFixer Jul 22, 2024
95ba340
Fix merge conflicts when rebasing on master
TheFixer Sep 2, 2024
2345f50
Resolve merge conflicts related to logging and documentation
TheFixer Sep 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -110,10 +110,6 @@ if(ENABLE_ICEORYX)
endif()
endif()

if(ENABLE_DURABILITY)
message(STATUS "Building with Durable support")
endif()

if(BUILD_TESTING)
add_subdirectory(ucunit)
endif()
@@ -126,7 +122,8 @@ add_subdirectory(security)
if(ENABLE_ICEORYX)
add_subdirectory(psmx_iox)
endif()
add_subdirectory(core)
if(ENABLE_DURABILITY)
message(STATUS "Building with Durable support")
add_subdirectory(durability)
endif()
add_subdirectory(core)
7 changes: 2 additions & 5 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -58,10 +58,6 @@ if(ENABLE_SECURITY)
$<BUILD_INTERFACE:$<TARGET_PROPERTY:security_api,INTERFACE_INCLUDE_DIRECTORIES>>)
endif()

if(ENABLE_DURABILITY)
target_link_libraries(ddsc PRIVATE "$<BUILD_INTERFACE:durability>")
endif()

include(cdr/CMakeLists.txt)
include(ddsi/CMakeLists.txt)
include(ddsc/CMakeLists.txt)
@@ -93,7 +89,8 @@ target_compile_definitions(
$<BUILD_INTERFACE:$<TARGET_PROPERTY:ddsrt,INTERFACE_COMPILE_DEFINITIONS>>)
target_include_directories(
ddsc PUBLIC
$<BUILD_INTERFACE:$<TARGET_PROPERTY:ddsrt,INTERFACE_INCLUDE_DIRECTORIES>>)
$<BUILD_INTERFACE:$<TARGET_PROPERTY:ddsrt,INTERFACE_INCLUDE_DIRECTORIES>>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/durability/include>)

# SOVERSION should increase on incompatible ABI change
set_target_properties(ddsc PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
1 change: 1 addition & 0 deletions src/core/ddsc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ prepend(srcs_ddsc "${CMAKE_CURRENT_LIST_DIR}/src/"
dds_loaned_sample.c
dds_heap_loan.c
dds_psmx.c
dds_durability.c
)

if(ENABLE_TYPELIB)
2 changes: 2 additions & 0 deletions src/core/ddsc/src/dds__types.h
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
#include "dds/ddsrt/avl.h"
#include "dds/ddsi/ddsi_builtin_topic_if.h"
#include "dds/ddsc/dds_psmx.h"
#include "dds/durability/dds_durability_public.h"
#include "dds__handles.h"
#include "dds__loaned_sample.h"

@@ -306,6 +307,7 @@ typedef struct dds_domain {
struct dds_serdatapool *serpool;

struct dds_psmx_set psmx_instances;
dds_durability_t dc; // Durability client
} dds_domain;

typedef struct dds_subscriber {
5 changes: 5 additions & 0 deletions src/core/ddsc/src/dds_domain.c
Original file line number Diff line number Diff line change
@@ -128,6 +128,9 @@ static dds_entity_t dds_domain_init (dds_domain *domain, dds_domainid_t domain_i
if ((ret = dds_pubsub_message_exchange_init (&domain->gv, domain)) != DDS_RETCODE_OK)
goto fail_psmx_init;

if ((ret = dds_durability_load (&domain->dc, &domain->gv)) != DDS_RETCODE_OK)
goto fail_durability_init;

struct ddsi_psmx_instance_locators psmx_locators;
psmx_locators.length = domain->psmx_instances.length;
psmx_locators.instances = dds_alloc (domain->psmx_instances.length * sizeof (*psmx_locators.instances));
@@ -207,6 +210,7 @@ static dds_entity_t dds_domain_init (dds_domain *domain, dds_domainid_t domain_i
domain->psmx_instances.instances[i]->ops.deinit(domain->psmx_instances.instances[i]);
domain->psmx_instances.instances[i] = NULL;
}
fail_durability_init:
fail_psmx_init:
fail_ddsi_config:
if (domain->cfgst)
@@ -337,6 +341,7 @@ static dds_return_t dds_domain_free (dds_entity *vdomain)

ddsi_fini (&domain->gv);

dds_durability_unload (&domain->dc);
(void) dds_pubsub_message_exchange_fini (domain);

dds_serdatapool_free (domain->serpool);
70 changes: 70 additions & 0 deletions src/core/ddsc/src/dds_durability.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/

#include "dds/durability/dds_durability_public.h"
#include "dds/ddsi/ddsi_log.h"
#include <string.h>

void dds_durability_fini (dds_durability_t* dc)
{
#ifdef DDS_HAS_DURABILITY
/*
In the cleanup phase, the durability client's participant will always be the last remaining participant on the domain.
Thus if the domain is implicit, it will trigger deletion of the domain, which in turn unloads the durability plugin.

So if the participant were to be deleted from inside the plugin, it would result in a fatal error when
the program tries to return (as it unwinds the call stack) to the plugin function that called `dds_delete()` on the participant.

Therefore, in order to safely delete the participant of the durability client,
its handle needs to be smuggled out so it can be deleted by a function that isn't part of the plugin itself.
*/
assert(dc->_dds_durability_fini);
dds_entity_t pp = dc->_dds_durability_fini();
if ( pp != 0 ) {
dds_delete(pp);
}
#endif
}

dds_return_t dds_durability_load (dds_durability_t* dc, const struct ddsi_domaingv* gv)
{
memset(dc, 0x0, sizeof(dds_durability_t));
#ifdef DDS_HAS_DURABILITY
dds_return_t (*creator)(dds_durability_t* dc);
ddsrt_dynlib_t handle = NULL;
dds_return_t ret;
if ((ret = ddsrt_dlopen("durability", true, &handle)) != DDS_RETCODE_OK) {
char buf[256];
ddsrt_dlerror(buf, sizeof(buf));
GVERROR("dlopen: %s\n", buf);
return ret;
}
if ((ret = ddsrt_dlsym(handle, "dds_durability_creator", (void**)&creator)) != DDS_RETCODE_OK) {
char buf[256];
ddsrt_dlerror(buf, sizeof(buf));
GVERROR("dlsym: %s\n", buf);
(void)ddsrt_dlclose(handle);
return ret;
}
creator(dc);
dc->lib_handle = handle;
#endif
return DDS_RETCODE_OK;
}

void dds_durability_unload (dds_durability_t* dc)
{
#ifdef DDS_HAS_DURABILITY
assert(dc->lib_handle);
(void)ddsrt_dlclose(dc->lib_handle);
#endif
}
11 changes: 3 additions & 8 deletions src/core/ddsc/src/dds_participant.c
Original file line number Diff line number Diff line change
@@ -27,10 +27,6 @@
#include "dds__builtin.h"
#include "dds__qos.h"

#ifdef DDS_HAS_DURABILITY
#include "dds/durability/dds_durability.h"
#endif

DECL_ENTITY_LOCK_UNLOCK (dds_participant)

#define DDS_PARTICIPANT_STATUS_MASK (0u)
@@ -62,9 +58,7 @@ static dds_return_t dds_participant_delete (dds_entity *e)
DDS_CERROR (&e->m_domain->gv.logconfig, "dds_participant_delete: internal error %"PRId32"\n", ret);
ddsi_thread_state_asleep (ddsi_lookup_thread_state ());

#ifdef DDS_HAS_DURABILITY
(void)dds_durability_fini();
#endif
dds_durability_fini(&e->m_domain->dc);

/* todo It seems incorrect that dds_participant_delete()
* always returns DDS_RETCODE_OK, even if an error has
@@ -179,8 +173,9 @@ dds_entity_t dds_create_participant (const dds_domainid_t domain, const dds_qos_
dds_entity_unpin_and_drop_ref (&dds_global.m_entity);

#ifdef DDS_HAS_DURABILITY
assert(dom->dc.dds_durability_init);
if (ret > 0) {
(void)dds_durability_init (domain, &dom->gv);
(void)dom->dc.dds_durability_init (domain, &dom->gv);
}
#endif

7 changes: 2 additions & 5 deletions src/core/ddsc/src/dds_reader.c
Original file line number Diff line number Diff line change
@@ -51,10 +51,6 @@
#include "dds/ddsi/ddsi_tkmap.h"
#endif

#ifdef DDS_HAS_DURABILITY
#include "dds/durability/dds_durability.h"
#endif

DECL_ENTITY_LOCK_UNLOCK (dds_reader)

#define DDS_READER_STATUS_MASK \
@@ -779,8 +775,9 @@ static dds_entity_t dds_create_reader_int (dds_entity_t participant_or_subscribe
dds_subscriber_unlock (sub);

#ifdef DDS_HAS_DURABILITY
assert(rd->m_entity.m_domain->dc.dds_durability_new_local_reader);
if (dkind >= DDS_DURABILITY_TRANSIENT) {
dds_durability_new_local_reader(reader, rhc);
rd->m_entity.m_domain->dc.dds_durability_new_local_reader(reader, rhc);
}
#endif

12 changes: 7 additions & 5 deletions src/core/ddsc/src/dds_write.c
Original file line number Diff line number Diff line change
@@ -31,10 +31,6 @@
#include "dds__loaned_sample.h"
#include "dds__psmx.h"

#ifdef DDS_HAS_DURABILITY
#include "dds/durability/dds_durability.h"
#endif

struct ddsi_serdata_plain { struct ddsi_serdata p; };
struct ddsi_serdata_any { struct ddsi_serdata a; };

@@ -47,14 +43,20 @@ dds_return_t dds_write (dds_entity_t writer, const void *data)
return DDS_RETCODE_BAD_PARAMETER;

#ifdef DDS_HAS_DURABILITY
if ((ret = dds_writer_lock (writer, &wr)) != DDS_RETCODE_OK)
return ret;
dds_durability_t* dc = &wr->m_entity.m_domain->dc;
dds_writer_unlock (wr);

/* determine if the quorum of durable services for the writer is fulfilled.
*
* LH: This implementation may be suboptimal, because determining whether the
* quorum is fulfilled, and the actual publication of the data is not done
* within the same writer lock. So after the quorum has been established,
* and before the data is published, the quorum could have been dropped again.
* Chances for this to happen are slim, but still ... */
if ((ret = dds_durability_wait_for_quorum(writer)) != DDS_RETCODE_OK) {
assert(dc->dds_durability_wait_for_quorum);
if ((ret = dc->dds_durability_wait_for_quorum(writer)) != DDS_RETCODE_OK) {
return ret;
}
#endif
12 changes: 5 additions & 7 deletions src/core/ddsc/src/dds_writer.c
Original file line number Diff line number Diff line change
@@ -38,10 +38,6 @@
#include "dds__statistics.h"
#include "dds__psmx.h"

#ifdef DDS_HAS_DURABILITY
#include "dds/durability/dds_durability.h"
#endif

DECL_ENTITY_LOCK_UNLOCK (dds_writer)

#define DDS_WRITER_STATUS_MASK \
@@ -426,13 +422,14 @@ dds_entity_t dds_create_writer (dds_entity_t participant_or_publisher, dds_entit
if ((rc = dds_endpoint_add_psmx_endpoint (&wr->m_endpoint, wqos, &tp->m_ktopic->psmx_topics, DDS_PSMX_ENDPOINT_TYPE_WRITER)) != DDS_RETCODE_OK)
goto err_pipe_open;

#if DDS_HAS_DURABILITY
#ifdef DDS_HAS_DURABILITY
/* quorum applies only to durable writers.
* By default quorum reached for volatile and transient-local writers
* For durable writer the quorum is initially reached when quorum threshold == 0
* (but we'll likely prohibit this case as an invalid configuration because
* it may lead to eventual inconsistencies). */
uint32_t quorum = dds_durability_get_quorum();
assert(wr->m_entity.m_domain->dc.dds_durability_get_quorum);
uint32_t quorum = wr->m_entity.m_domain->dc.dds_durability_get_quorum();
wr->quorum_reached = true;
if (wqos->durability.kind >= DDS_DURABILITY_TRANSIENT) {
wr->quorum_reached = (quorum == 0);
@@ -460,7 +457,8 @@ dds_entity_t dds_create_writer (dds_entity_t participant_or_publisher, dds_entit
dds_publisher_unlock (pub);

#ifdef DDS_HAS_DURABILITY
dds_durability_new_local_writer(writer);
assert(wr->m_entity.m_domain->dc.dds_durability_new_local_writer);
wr->m_entity.m_domain->dc.dds_durability_new_local_writer(writer);
#endif

// start async thread if not already started and the latency budget is non zero
3 changes: 2 additions & 1 deletion src/core/xtests/symbol_export/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -18,7 +18,8 @@ target_include_directories(symbol_export_test PRIVATE
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/include/>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../ddsc/src>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../ddsi/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../cdr/include>")
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../cdr/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../durability/include>")

if (ENABLE_SECURITY)
target_link_libraries(symbol_export_test PRIVATE security_api)
45 changes: 19 additions & 26 deletions src/durability/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -7,32 +7,25 @@
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}")
set(binary_dir "${CMAKE_CURRENT_BINARY_DIR}")

add_library(durability INTERFACE)

target_include_directories(
durability INTERFACE
"$<BUILD_INTERFACE:${source_dir}/include>"
"$<BUILD_INTERFACE:${source_dir}/src>"
"$<BUILD_INTERFACE:${binary_dir}/include>")

set(headers
"${source_dir}/include/dds/durability/dds_durability.h"
"${source_dir}/include/dds/durability/durablesupport.h")

set(sources
"${source_dir}/src/dds_durability.c"
"${source_dir}/src/durablesupport.c")

target_sources(durability INTERFACE ${headers} ${sources})
idlc_generate(TARGET dcidl FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/durablesupport.idl")
add_library(durability SHARED "${CMAKE_CURRENT_SOURCE_DIR}/src/dds_durability.c")
set_property(TARGET durability PROPERTY C_VISIBILITY_PRESET hidden)
target_include_directories(durability PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/ddsrt/include>"
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/ddsc/include>"
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/ddsi/include>"
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/cdr/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/ddsrt/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/core/include>"
)
target_link_libraries(durability PRIVATE dcidl)

install(
DIRECTORY
"${source_dir}/include/"
"${binary_dir}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT dev
FILES_MATCHING PATTERN "*.h")
TARGETS durability
EXPORT "${PROJECT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
42 changes: 0 additions & 42 deletions src/durability/include/dds/durability/dds_durability.h

This file was deleted.

Loading
Oops, something went wrong.