Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Unit tests for XmlRpcDispatch#1232

Merged
dirk-thomas merged 3 commits intoros:lunar-develfrom
trainman419:trainman419/fix_xmlrpcpp_bugs_4
Nov 16, 2017
Merged

Unit tests for XmlRpcDispatch#1232
dirk-thomas merged 3 commits intoros:lunar-develfrom
trainman419:trainman419/fix_xmlrpcpp_bugs_4

Conversation

@trainman419
Copy link
Copy Markdown
Contributor

  • Fix handling of out-of-band (Exception) request and and event processing to match previous select() implementation.
  • Update comments to describe the events that actually trigger and Exception state.
  • Unit tests for XmlRpcDispatch to verify that it calls poll() correctly, requests the correct events and calls the correct handler for those events.

* Fix handling of out-of-band (Exception) request and and event
processing to match previous select() implementation.
* Update comments to describe the events that actually trigger and
Exception state.
* Unit tests for XmlRpcDispatch to verify that it calls poll()
correctly, requests the correct events and calls the correct handler
for those events.
@trainman419
Copy link
Copy Markdown
Contributor Author

Bump. @dirk-thomas @mikepurvis ?

newMask &= src->handleEvent(WritableEvent);
if (pfd.revents & POLLEX_CHK)
if (oob && (pfd.revents & POLLEX_CHK))
newMask &= src->handleEvent(Exception);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe more about what is going on here? Is this a behaviour change/fix which arose as a result of the added tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially wrote this test against the previous version of this, which was using select(), since our internal fork of ROS is mostly based on Indigo. When I updated this test to the most recent version of ros_comm to get the poll() implementation, it no longer behaved the same way when there was an exception event on the socket. This fixes it so that the poll() implementation behaves more like the original select() implementation.

Also of note is that for TCP sockets, the exception event actually indicates the reception of out-of-band data over the TCP connection, and doesn't indicate an error event on the socket. I've updated the comments and the implementation to reflect this and restore the original behavior.

(I light of this I think the original behavior might be a little misguided, but my goal here is to preserve all of the existing behavior that isn't clearly a bug.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun, okay. Yeah, we're having some similar issues with select/poll/epoll subtleties over in #1217.

@mikepurvis
Copy link
Copy Markdown
Member

This all seems reasonable to me, but TBH I've never really had to grapple with these internals before, so my thumbs-up is not the most valuable one.

Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I will wait with the merge until CI is green and @trainman419 had a chance to answer the pending question from @mikepurvis.

@dirk-thomas
Copy link
Copy Markdown
Member

@ros-pull-request-builder retest this please

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants