Skip to content

rgw: pull up beast submodule and update frontend - #17923

Merged
yehudasa merged 6 commits into
ceph:masterfrom
cbodley:wip-rgw-beast-update
Nov 3, 2017
Merged

yehudasa merged 6 commits into
ceph:masterfrom
cbodley:wip-rgw-beast-update

Conversation

@cbodley

@cbodley cbodley commented Sep 22, 2017 •

Copy link
Copy Markdown
Contributor

updates the Beast submodule to point at v116, which is the current master branch of https://github.com/boostorg/beast. our fork at https://github.com/ceph/beast/ has been updated to match

after updating the beast frontend, swift and s3tests are still passing

@cbodley cbodley added the rgw label Sep 22, 2017
@cbodley cbodley changed the title [DNM] rgw: pull up beast submodule and update frontend rgw: pull up beast submodule and update frontend Sep 22, 2017
@cbodley
cbodley requested a review from rzarzynski September 25, 2017 14:23
Comment thread src/rgw/rgw_asio_frontend.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to have the discard_buffer as a part of the Connection's state? Are we interested in its content?

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.

we never read its content, no. the only requirement is that the buffer stays alive between discard_unread_message() and the on_discard_unread() callback. keeping it in the connection avoids the need to allocate/free

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. Maybe we could have it as a static in discard_unread_message()? What do you think?

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.

good idea! updated, with a comment explaining that it's okay for multiple clients to share the static discard_buffer

@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from 3986bf2 to 682d9cb Compare September 26, 2017 16:42
@cbodley

cbodley commented Sep 26, 2017

Copy link
Copy Markdown
Contributor Author

teuthology results show no test failures, but some new valgrind leaks coming from rgw Options

@cbodley

cbodley commented Sep 26, 2017

Copy link
Copy Markdown
Contributor Author

tested in teuthology with #17977 as the suite-branch

Comment thread src/rgw/rgw_asio_frontend.cc Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you don't set the reason explicitly, Beast will fill in an appropriate string for you during serialization

Comment thread src/rgw/rgw_asio_client.cc Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So this means that your incoming HTTP message bodies cannot be larger than the buffer size?

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.

our request handlers will call this read_data(char* buf, size_t max) function repeatedly to read the body in pieces. as i understand it, by breaking on need_buffer here and returning successfully, we indicate to the caller that it needs to provide another buffer

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

but the code also breaks on connection_reset, is the intention to treat connection_reset the same as need_buffer?

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.

agreed, connection_reset doesn't belong here. it was only working because the request handler's loop terminates on a zero-length read. after removing that check for connection_reset, i found that we have one s3test case, test_atomic_dual_conditional_write_1mb, that exercises that error path and logs failed to read body: Connection reset by peer

pr updated - thanks again!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

Comment thread src/rgw/rgw_asio_frontend.cc Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you are using parser::header_limit you can just default construct this flat buffer.

@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from 682d9cb to a3f97cd Compare September 27, 2017 13:28
@cbodley

cbodley commented Sep 27, 2017

Copy link
Copy Markdown
Contributor Author

@vinniefalco incorporated your feedback. your review is much appreciated, thank you!

@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from a3f97cd to cac0b64 Compare September 27, 2017 17:24
@cbodley

cbodley commented Oct 10, 2017

Copy link
Copy Markdown
Contributor Author

teuthology testing was all green except for multisite tests. the testing branch was missing the fix in 3f4f760, so i've rebased and will test again once packages are built

Comment thread src/rgw/rgw_asio_client.cc Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

oops..this isn't right. The Connection field is a comma-separated list of tokens. And the "keep-alive" property depends not only on the value in the field but also the HTTP version. Fortunately, beast::http::message provides a member function to do the dirty work for you:
http://www.boost.org/doc/libs/master/libs/beast/doc/html/beast/ref/boost__beast__http__message/keep_alive/overload1.html

If keep_alive() returns true then the connection has keep-alive semantics. Otherwise, it has close semantics. You only need to track one bool instead of two.

Comment thread src/rgw/rgw_asio_client.h Outdated

@vinniefalco vinniefalco Oct 10, 2017 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider using parser_type = beast::http::request_parser<beast::http::buffer_body> instead

@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from cac0b64 to bdc1425 Compare October 11, 2017 13:15
@cbodley

cbodley commented Oct 19, 2017

Copy link
Copy Markdown
Contributor Author

@rzarzynski mind taking another look? passes all teuthology tests except for multisite (due to a defect with dynamic reconfiguration fixed separately in #18402)

Comment thread src/rgw/rgw_asio_client.h Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're bringing in websocket and zlib headers too, this could slow down your build by a tiny bit. You could instead write

#include <boost/beast/http.hpp>

Up to you

@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from bdc1425 to a555cc1 Compare October 19, 2017 19:37
@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from a555cc1 to 24055ab Compare October 26, 2017 20:57
the beast frontend no longer uses stackful coroutines, so these
dependencies aren't necessary

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley force-pushed the wip-rgw-beast-update branch from 24055ab to 5d7f154 Compare October 27, 2017 15:29
@cbodley

cbodley commented Oct 30, 2017

Copy link
Copy Markdown
Contributor Author

@cbodley
cbodley requested a review from oritwas October 30, 2017 15:32
@vinniefalco

Copy link
Copy Markdown

Heads up: Version 125 and later of Beast will require Boost 1.66.0 (or the tip of the Boost master branch). Which means it will probably break your project until you upgrade to the 1.66.0. I have created a tag, v124 so you can pin your submodule to the latest version that doesn't require the newest Boost:
https://github.com/boostorg/beast/tree/v124

@cbodley

cbodley commented Oct 30, 2017

Copy link
Copy Markdown
Contributor Author

thanks @vinniefalco! i'll take a look at pulling in v124

@oritwas

oritwas commented Nov 2, 2017

Copy link
Copy Markdown
Member

looks great!

@yehudasa
yehudasa merged commit a27b28e into ceph:master Nov 3, 2017
@cbodley
cbodley deleted the wip-rgw-beast-update branch November 3, 2017 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants