Skip to content

Commit ac0a79b

Browse files
committed
Refs #22901. Handle key computation failure in DataReaderHistory.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 28cd4b1 commit ac0a79b

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,14 @@ bool DataReaderHistory::received_change_keep_all(
215215
{
216216
if (!compute_key_for_change_fn_(a_change))
217217
{
218-
// Store the sample temporally only in ReaderHistory. When completed it will be stored in DataReaderHistory too.
219-
return add_to_reader_history_if_not_full(a_change, rejection_reason);
218+
if (!a_change->is_fully_assembled())
219+
{
220+
// Store the sample temporally only in ReaderHistory. When completed it will be stored in SubscriberHistory too.
221+
return add_to_reader_history_if_not_full(a_change, rejection_reason);
222+
}
223+
224+
rejection_reason = REJECTED_BY_INSTANCES_LIMIT;
225+
return false;
220226
}
221227

222228
bool ret_value = false;
@@ -251,8 +257,14 @@ bool DataReaderHistory::received_change_keep_last(
251257
{
252258
if (!compute_key_for_change_fn_(a_change))
253259
{
254-
// Store the sample temporally only in ReaderHistory. When completed it will be stored in SubscriberHistory too.
255-
return add_to_reader_history_if_not_full(a_change, rejection_reason);
260+
if (!a_change->is_fully_assembled())
261+
{
262+
// Store the sample temporally only in ReaderHistory. When completed it will be stored in SubscriberHistory too.
263+
return add_to_reader_history_if_not_full(a_change, rejection_reason);
264+
}
265+
266+
rejection_reason = REJECTED_BY_INSTANCES_LIMIT;
267+
return false;
256268
}
257269

258270
bool ret_value = false;

0 commit comments

Comments
 (0)