Skip to content

Send.timeout - #20

Open
jaynel wants to merge 5 commits into
duomark:masterfrom
jaynel:send.timeout
Open

Send.timeout#20
jaynel wants to merge 5 commits into
duomark:masterfrom
jaynel:send.timeout

Conversation

@jaynel

@jaynel jaynel commented Nov 4, 2014

Copy link
Copy Markdown
Member

No description provided.

Only affects elysium_buffer_sup.erl.
Elysium_channel is a replacement for seestar_session which avoids
using the multiplexing logic for Cassandra queries. This logic is
brittle in the face of failure, and the elysium approach avoids
reusing a Cassandra connection for multiple simultaneous requests.

The channel is essentially a copy of seestar_session with some
code removed, so the compilation environment needed to handle
R16 vs R17 datatypes, thus the new elysium_compile_utils module.

Epocxy was upgraded to 0.9.8 mostly to allow the introduction
of synchronization barriers for testing purposes. As of yet,
there is no real dependency on 0.9.8 but other projects which
use elysium needed the latest version.

Seestar was upgraded to tigertext 0.1.1 which is a fork of
iamaleksey/seestar master. The introduction of elysium_channel
is incompatible with seestar_session in that mixing the two
types of sessions is not a good idea. The changes tigertext
wanted for seestar_session (send timeouts and a reduced
receive timeout) can only be applied properly in a world of
single requests on a socket. The multiplexing approach must
wait forever because it cannot distinguish timeouts on all
the outstanding requests.

The brittleness in seestar is due to the fact that all the
pending requests are kept in a gen_server state, with overflow
going to an ets table. If the seestar_session gen_server
goes down it will take all the requests that are waiting
for replies with it. Worse, since the gen_server owns the
ets table, it will also take down all the pending requests
that haven't been sent to Cassandra. In process Cassandra
requests have to be lost in any case since the socket will
be closed, but the untransmitted requests should still be
able to be managed.

In the end, having monoplexed requests makes recoverability
and resilience easier, plus it allows us to rely on normal
gen_server and gen_tcp:send timeouts to identify when the
connection to Cassandra is not working normally.
@jaynel
jaynel force-pushed the master branch 6 times, most recently from 2deb28e to 6089bd1 Compare November 11, 2014 22:57
jaynel pushed a commit that referenced this pull request Nov 21, 2014
Introduce elysium_buffering_strategy behaviour
@jaynel
jaynel force-pushed the master branch 6 times, most recently from 03afe70 to cff4578 Compare April 24, 2015 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant