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

DataWriter failed: OutOfResources #202

Open
fgadaleta opened this issue Jun 10, 2022 · 2 comments
Open

DataWriter failed: OutOfResources #202

fgadaleta opened this issue Jun 10, 2022 · 2 comments

Comments

@fgadaleta
Copy link

I am writing some code from the shape example.
Basically, I have a component that uses DDS on behalf of internal apps and other components. So I have created one writer and one reader for each topic, and placed them behind

    writers: HashMap<usize, Arc<Mutex<DataWriter<Message>>>>,
    readers: HashMap<usize, Arc<Mutex<DataReader<Message>>>>,

as different threads will have access to.

I am using exactly the same structure of the Shape example, except that now every topic has one reader and one writer. Hence, if one wants to write to a topic, needs to get the writer of that topic, lock on it via the Mutex and proceed with writing.
It seems quite natural to me, until I get OutOfResources error like the following, every time I try to write to a topic (which exists and which has a (writer,reader) pair.

2022-06-10T10:36:09.343323456+02:00 ERROR dds - DataWriter write failed: OutOfResources
2022-06-10T10:36:09.343440454+02:00 DEBUG dds - interacting with DDS
2022-06-10T10:36:09.843957986+02:00 WARN rustdds::dds::with_key::datawriter - Failed to write new data: topic="heartbeat"  reason=Disconnected  timeout=None
@jhelovuo
Copy link
Member

Please submit a minimal buildable code that reproduces the error.

@fgadaleta
Copy link
Author

fgadaleta commented Jun 29, 2022

Please submit a minimal buildable code that reproduces the error.

https://pastebin.com/X5CZebK0

Basically, I wrap a DDSInner into a DDS struct that i can initialize with new() and loop over with run().
(code is not really minimal but it reproduces the issue)

Error at runtime is:

[dds/src/lib.rs:618] "Writing message to topic {} " = "Writing message to topic {} "
[dds/src/lib.rs:618] &topic_name = "one"
2022-06-30T07:28:36.462127138+02:00 WARN rustdds::dds::with_key::datawriter - Failed to write new data: topic="one"  reason=Disconnected  timeout=None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants