eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.66k stars 388 forks source link

Workaround for wrong errno on QNX for mq_timedsend/mq_timereceive results in error message in latest QNX #956

Open elBoberido opened 2 years ago

elBoberido commented 2 years ago

Required information

Operating system: QNX SDP7.1

Compiler version: QCC 8

Details

On QNX SDP7.0 the errno for a timeout in mq_timedsend/mq_timedreceive was EINTR instead of ETIMEDOUT. To fix this, the posix::MessageQueue has a TIMEOUT_ERRNO constexpr which is set to EINTR on QNX and ETIMEDOUT on all other platforms.

Since we switched to unix domain sockets and the mqueue is not used, the class is not used. We need to decide whether we want to just use ETIMEDOUT and ignore QNX SDP 7.0 or add a compiler switch like #ifdef __QNX__ && __GCC__MAJOR_VERSION__ == 5. Since this class is not used anyway, removing the #ifdef might be the best option.

elBoberido commented 2 years ago

@dkroenke what is your opinion on this?

elfenpiff commented 2 years ago

@elBoberido @dkroenke I would suggest to add mq_timedsend and mq_timedreceive to the iox platform files (include/mqueue.hpp) as iox_mq_timesend and iox_mq_timedreceive (like we already do for iox_mq_open) and correct the behavior directly there and set the errno like it is stated in the POSIX manual. Then this behaves identical on every platform and we can get rid of macros, compiler checks and ifdefs in the production code.

This should also be our default approach whenever we discover platform specific code/macros inside the production code (except tests) to move that into the platform files.

elBoberido commented 2 years ago

@elfenpiff that's not quite the question here. The question is if we want to remove the workaround for SDP7.0 which means to handle this with the errno like it is stated in the POSIX manual or if we want to keep the workaround but tie it specifically to SDP7.0. Since this class is currently not used in iceoryx after the switch to unix domain sockets, we could take the easy route and remove the workaround and mark this as known limitation for this class on SDP7.0

elfenpiff commented 2 years ago

@elBoberido I would invest a little bit more time here since in the future someone may be interested in the hoofs as a standalone library and would like to use the message queue. Then it would be nice that it is working. But this is only when we are talking about maybe some more hours and not days.

As addendum to my previous comment: I would remove TIMEOUT_ERRNO from the message queue and handle everything consistently in the iox_mq_timed{send,receive} functions.

Or maybe I got the problem wrong :/

budrus commented 2 years ago

Developer Meeting: iceoryx posh doesn't use the message queue anymore. So this is only a problem if someone uses the abstraction for message queue standalone. Therefore low prio for now