8000 Fuerte simplify by graetzer · Pull Request #12270 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Fuerte simplify #12270

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

Merged
merged 31 commits into from
Aug 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2c04571
Simplify fuerte code
graetzer Jun 26, 2020
24c1529
fix #warning
graetzer Jun 26, 2020
3412930
Merge branch 'devel' of github.com:arangodb/arangodb into feature/fue…
graetzer Jun 29, 2020
002412b
change defaults
graetzer Jun 29, 2020
0a9ac62
slight fixes
graetzer Jun 30, 2020
95e2e4b
slight adjustments
graetzer Jul 1, 2020
9aa85fa
Starting HTTP/2 with Prior Knowledge
graetzer Jul 3, 2020
efa00a3
make consistent
graetzer Jul 3, 2020
46cb4a8
Merge branch 'feature/http2-prior-knowledge' into feature/fuerte-simp…
graetzer Jul 3, 2020
528a0f6
fix some requests
graetzer Jul 8, 2020
3fa1586
fix architectire
graetzer Jul 13, 2020
da6c3e4
Merge branch 'devel' of github.com:arangodb/arangodb into feature/fue…
graetzer Jul 13, 2020
a5e1da2
fix stuff
graetzer Jul 13, 2020
1426f9b
Properly cancel broken connections
graetzer Jul 14, 2020
e070136
remove extra log statements
graetzer Jul 14, 2020
05c578a
Merge branch 'devel' of github.com:arangodb/arangodb into feature/fue…
graetzer Jul 21, 2020
931c22e
remove unused code
graetzer Jul 21, 2020
a7bd312
some changes to vst
graetzer Jul 21, 2020
56e3a53
adjust TLA+ pluscal models
graetzer Jul 22, 2020
50da56c
Merge branch 'devel' of github.com:arangodb/arangodb into feature/fue…
graetzer Jul 22, 2020
b9208ea
fix some stuff
graetzer Jul 22, 2020
088a759
fix mistake
graetzer Jul 22, 2020
92a050f
fixing VST connection
graetzer Jul 23, 2020
67faddb
Merge remote-tracking branch 'origin/devel' into feature/fuerte-s 8000 implify
neunhoef Aug 20, 2020
b25c331
Correct mode: we call shutdownConnection when it is time.
neunhoef Aug 21, 2020
439abaa
File no longer necessary.
neunhoef Aug 21, 2020
17df268
Comment fixes.
neunhoef Aug 21, 2020
e4e9d4d
Add a forgotten alarm cancellation to model.
neunhoef Aug 21, 2020
092e27c
Fix cancellation in model.
neunhoef Aug 21, 2020
57e1777
Take latest transaction.
neunhoef Aug 21, 2020
d09a0a8
This is a sub-PR to suggest some changes. (#12495)
neunhoef Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix stuff
  • Loading branch information
graetzer committed Jul 13, 2020
commit a5e1da2e17ddececbaf5c9401aadfe7b5511c810
22 changes: 11 additions & 11 deletions 3rdParty/fuerte/src/GeneralConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GeneralConnection : public fuerte::Connection {

virtual ~GeneralConnection() noexcept {
_state.store(Connection::State::Closed);
terminateActivity();
terminateActivity(fuerte::Error::Canceled);
}

/// @brief connection state
Expand Down Expand Up @@ -93,7 +93,7 @@ class GeneralConnection : public fuerte::Connection {
}
item.release(); // queue owns this now

FUERTE_LOG_HTTPTRACE << "queued item: this=" << this << "\n";
FUERTE_LOG_DEBUG << "queued item: this=" << this << "\n";

10000
// Note that we have first posted on the queue with std::memory_order_seq_cst
// and now we check _active std::memory_order_seq_cst. This prevents a sleeping
Expand Down Expand Up @@ -151,19 +151,19 @@ class GeneralConnection : public fuerte::Connection {
if (!msg.empty()) {
FUERTE_LOG_DEBUG << ", msg = '" << msg<< "' ";
}
FUERTE_LOG_DEBUG<< "this=" << this << "\n";
FUERTE_LOG_DEBUG << "this=" << this << "\n";

auto exp = _state.load();
if (exp == Connection::State::Closed ||
!_state.compare_exchange_strong(exp, Connection::State::Closed)) {
FUERTE_LOG_DEBUG << "connection is already shutdown this=" << this << "\n";
return;
}

abortOngoingRequests(err);
drainQueue(err);

_proto.shutdown([=, self(shared_from_this())](auto const& ec) {
terminateActivity();
terminateActivity(err);
onFailure(err, msg);
}); // Close socket
}
Expand Down Expand Up @@ -195,6 +195,7 @@ class GeneralConnection : public fuerte::Connection {

/// abort all requests lingering in the queue
void drainQueue(const fuerte::Error ec) {
FUERTE_LOG_DEBUG << "drain queue this=" << this << "\n";
RT* item = nullptr;
while (_queue.pop(item)) {
FUERTE_ASSERT(item);
Expand All @@ -209,10 +210,10 @@ class GeneralConnection : public fuerte::Connection {
Connection::State state = this->_state.load();
FUERTE_ASSERT(state != Connection::State::Connecting);
if (state == Connection::State::Connected) {
FUERTE_LOG_HTTPTRACE << "activate: connected\n";
FUERTE_LOG_DEBUG << "activate: connected\n";
this->doWrite();
} else if (state == Connection::State::Created) {
FUERTE_LOG_HTTPTRACE << "activate: not connected\n";
FUERTE_LOG_DEBUG << "activate: not connected\n";
this->startConnection();
} else if (state == Connection::State::Closed) {
FUERTE_LOG_ERROR << "activate: queued request on failed connection\n";
Expand All @@ -227,16 +228,16 @@ class GeneralConnection : public fuerte::Connection {
/// The following is called when the connection is permanently failed. It is
/// used to shut down any activity in the derived classes in a way that avoids
/// sleeping barbers
void terminateActivity() {
void terminateActivity(const fuerte::Error err) {
// Usually, we are `active == true` when we get here, except for the following
// case: If we are inactive but the connection is still open and then the
// idle timeout goes off, then we shutdownConnection and in the TLS case we
// call this method here. In this case it is OK to simply proceed, therefore
// no assertion on `_active`.
FUERTE_ASSERT(this->_state.load() == Connection::State::Closed);
FUERTE_LOG_HTTPTRACE << "terminateActivity: active=true, this=" << this << "\n";
FUERTE_LOG_DEBUG << "terminateActivity: active=true, this=" << this << "\n";
while (true) {
this->drainQueue(Error::Canceled);
this->drainQueue(err);
this->_active.store(false);
// Now need to check again:
if (this->_queue.empty()) {
Expand Down Expand Up @@ -275,7 +276,6 @@ class GeneralConnection : public fuerte::Connection {
}

if (retries == 0) {
_state.store(Connection::State::Closed, std::memory_order_release);
std::string msg("connecting failed: '");
msg.append((ec != asio_ns::error::operation_aborted) ? ec.message() : "timeout");
msg.push_back('\'');
Expand Down
0