Closed jerry-xie-000 closed 1 month ago
@jerry-xie-000 are you sending the message with publisher.publish()
? or releasing it in any other way?
Yes, I sending the message with publisher.publish()
iox::popo::UntypedPublisher publisher({"adc", "data", "Object"});
while(true)
{
publisher.loan(g_data_size))
.and_then([&](auto& userPayload) {
...
publisher.publish(userPayload);
}
}
I just run the publisher application, and doesn't run the subscriber.
I try to just change the size with two different size alternately, the errors can be reproduced.
@jerry-xie-000 The error message Unable to loan sample, error code: AllocationError::TOO_MANY_CHUNKS_ALLOCATED_IN_PARALLEL
should only come when you loan messages on the publisher side and never release them. But since you call Publisher::publish()
which releases them, it should not occur.
Do you store some of the samples and do not publish them?
@elBoberido do you have any ideas here?
No, I just loan() and publish() each time, do not store any samples. If not change the loan size, the publisher can publish well, 60 times per second.
Sorry, it's my mistake. There is one code to return the function before Publisher::publish()
.
The variable
g_data_size
for publisher loan size should be modified each time, maybe 200, 2000,20000,200000, 200, 2000...After changing many times with different loan data size , these errors will be shown:
Is my usage wrong? We need to change loan data size in different situation.