Skip to content

Commit

Permalink
[#116] Add retrieve returned samples also to loan
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Feb 18, 2024
1 parent c245344 commit dcdc80f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/release-notes/iceoryx2-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<!-- NOTE: Add new entries sorted by issue number to minimize the possibility of conflicts when merging. -->

* Fix retrieve channel overflow caused by big publisher loans [#116](https://github.com/eclipse-iceoryx/iceoryx2/issues/116)
* Fix `open_or_create` race [#108](https://github.com/eclipse-iceoryx/iceoryx2/issues/108)
* Fix undefined behavior in `spsc::{queue|index_queue}` [#87](https://github.com/eclipse-iceoryx/iceoryx2/issues/87)

Expand Down
2 changes: 2 additions & 0 deletions iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ impl<'a, Service: service::Service, MessageType: Debug> UninitLoan<MessageType>
fn loan_uninit(&self) -> Result<SampleMut<MaybeUninit<MessageType>>, PublisherLoanError> {
let msg = "Unable to loan Sample";

self.retrieve_returned_samples();

if self.loan_counter.load(Ordering::Relaxed) >= self.config.max_loaned_samples {
fail!(from self, with PublisherLoanError::ExceedsMaxLoanedChunks,
"{} since already {} samples were loaned and it would exceed the maximum of parallel loans of {}. Release or send a loaned sample to loan another sample.",
Expand Down

0 comments on commit dcdc80f

Please sign in to comment.