DDS_DataReader_create_querycondition:INTERNAL ERROR: illegal operation

2 posts / 0 new
Last post
Offline
Last seen: 1 month 4 weeks ago
Joined: 07/08/2021
Posts: 4
DDS_DataReader_create_querycondition:INTERNAL ERROR: illegal operation

I have a QueryCondition that is causing this error within  on_data_available from the listener.

[0x010163C8,0x6217B22F,0xEBB9540A:0x80000007{E=DR,I=21}|RECEIVE FROM 0x01018296,0x66DDB063,0x477B96E0:0x80000002|CREATE READ CONDITION] DDS_DomainParticipantGlobals_is_operation_legalI:INTERNAL ERROR: illegal operation due to exclusive area problem. Cannot enter EA from level 20 to level 10 [0x010163C8,0x6217B22F,0xEBB9540A:0x80000007{E=DR,I=21}|RECEIVE FROM 0x01018296,0x66DDB063,0x477B96E0:0x80000002|CREATE READ CONDITION] DDS_DataReader_create_querycondition:INTERNAL ERROR: illegal operation [0x010163C8,0x6217B22F,0xEBB9540A:0x80000007{E=DR,I=21}|RECEIVE FROM 0x01018296,0x66DDB063,0x477B96E0:0x80000002] data_available_forward:!Failed to create DDS_QueryCondition

The code I have for the condition is as follows.

std::vector<std::string> params = { a_mat };

dds::sub::cond::QueryCondition query_condition(

    dds::sub::Query(reader, "material NOT %0", params),

    dds::sub::status::DataState::any_data());

auto materials = reader.select().condition(query_condition).take();

It appears my condition (query?) is somehow not correct. What I am intending to say is, if a sample with the field material does not match the contents of a_mat, then I want that sample to be included in objs. Based on the documentation saying the expression is like an SQL WHERE clause, I also tried  != and <>.

Any ideas?

Keywords:
Howard's picture
Offline
Last seen: 2 days 5 hours ago
Joined: 11/29/2012
Posts: 270

Nope, this has nothing to do with your Query Expression.  (your expression should use <> for not equals i believe).

The problem is that you can only call a reduced set of DDS APIs on only a certain set of DDS Entities while in a DDS listener.  Exclusive Area violations is DDS telling you that you're calling a function that's not allowed to be called.

This is to prevent deadlocks between DDS threads...including the one that's calling your listener.

You can learn more about this by searching for "Exclusive Area" on community.rti.com or in the Users Manual.

Thus, you'll need to find a different way to create your Query Condition, like in the listener constructor for example.   I would guess that you should be able to set the parameter of a pre-created Query Condition in the context of a listener.

Of course, to avoid this issue altogether, I would suggest using a WaitSet to receive and process the data in your own thread...user threads can call any DDS API without this Exclusive Area restriction.