erlang: Add a state-propagation-testing transport
authorDavid Reiss <dreiss@apache.org>
Mon, 30 Aug 2010 22:05:44 +0000 (22:05 +0000)
committerDavid Reiss <dreiss@apache.org>
Mon, 30 Aug 2010 22:05:44 +0000 (22:05 +0000)
commit9b170ebf104c45532c553f8447346cd43b37449c
tree54fe686c77e5f2d4836fa8b91a6bbb487a09188b
parent639e1cfe2b9eb6e9e852899adeeec8a41daeda81
erlang: Add a state-propagation-testing transport

Add a transport implementation that forwards all read and write (and
flush and close) requests directly to a wrapped transport.  In addition,
it keeps a small amount of state: a version number that is incremented
on each operation and the PID of a process that stores another copy of
the version number.  Every operation compares the version numbers and
increments both.  If some part of the Thrift stack doesn't propagate
state updates properly, the two versions will not match.

Also add some (compiled-off by default) code to thrift_transport to
auto-wrap every transport in a state checker.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990990 13f79535-47bb-0310-9956-ffa450edef68
lib/erl/src/thrift_transport.erl
lib/erl/src/thrift_transport_state_test.erl [new file with mode: 0644]