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

keep the persistent connection only if rosmaster supports http1.1 #2208

Merged

Conversation

iuhilnehc-ynos
Copy link
Contributor

to fix #2182

Signed-off-by: Chen Lihui lihui.chen@sony.com

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@fujitatomoya
Copy link
Contributor

@sloretz @jacobperron @mjcarroll friendly ping, requesting maintainer review.

Copy link
Contributor

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

The changes look okay to me, but this breaks ABI. I'd rather not release an ABI-breaking change into an already released distribution. Maybe there's a way to make this fix ABI-compatible?

@@ -118,6 +118,9 @@ namespace XmlRpc {
// each thread should have its own client.
bool _executing;

// True if the server supports HTTP1.1
bool _server_http_1_1;
Copy link
Contributor

@jacobperron jacobperron Dec 2, 2021

Choose a reason for hiding this comment

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

This change breaks ABI.

Copy link
Contributor

Choose a reason for hiding this comment

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

but this breaks ABI.

our bad, that should be kept...sorry.

Copy link
Contributor Author

@iuhilnehc-ynos iuhilnehc-ynos Dec 3, 2021

Choose a reason for hiding this comment

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

I knew it breaks ABI, but it's clear.
I tried to use _connectionState, but some source code might be as

enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE,
        CLIENT_CONNECT_STATE_MASK = 0xFFFF, SERVER_HTTP_DISCONNECT = 0x10000};

check header to set _connectionState:
  _connectionState |= SERVER_HTTP_DISCONNECT;

set:
_connectionState = READ_HEADER;
  -->
_connectionState |= READ_HEADER;


if (_connectionState == WRITE_REQUEST)
   -->
if (_connectionState & CLIENT_CONNECT_STATE_MASK == WRITE_REQUEST)

check if SERVER_HTTP_DISCONNECT:
if (_connectionState & SERVER_HTTP_DISCONNECT)

do you think it's acceptable?
It seems to not work fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any other suggestions? I'd like to hear that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make use of the _header member variable, make it not clean after XmlRpcClient::readHeader, and then check it here and clean it.

…p1.1"

This reverts commit 2cb7602.

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@iuhilnehc-ynos iuhilnehc-ynos force-pushed the topic-server-not-support-http_1_1 branch from 2a3f123 to 7750cc5 Compare December 3, 2021 04:46
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@peci1
Copy link
Contributor

peci1 commented Dec 3, 2021

I confirm this patch fixed #2182 for me on Jetson Xavier AGX (kernel 4.9.253) running Melodic. Also, the performance from #2132 is not affected.

Thanks a lot for investigating!

Copy link
Contributor

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

utilities/xmlrpcpp/src/XmlRpcClient.cpp Outdated Show resolved Hide resolved
@jacobperron jacobperron merged commit a1b9433 into ros:noetic-devel Dec 3, 2021
@peci1
Copy link
Contributor

peci1 commented Jan 5, 2022

Should I take care of the Melodic backport? Or is it planned?

@jacobperron
Copy link
Contributor

Should I take care of the Melodic backport? Or is it planned?

I think a maintainer can include it in a backport PR, e.g. #2152

jacobperron added a commit that referenced this pull request Jan 25, 2022
)

* keep the persistent connection only if rosmaster supports http1.1

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* Revert "keep the persistent connection only if rosmaster supports http1.1"

This reverts commit 2cb7602.

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* fix without breaking ABI

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* Update comment

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regression from #2132: ros::param::set limited to 32 kB on localhost on computers with kernel 4.x
4 participants