Take the Dispatch lock in InfRcTransport::PayloadChunk::~PayloadChunk(). Not doing so allows multiple threads to occasionally muck around inside the transport simultaneously, leading to many bizarre errors, including what appear to be wedged ReplicatedSegments, or servers getting requests with totally bogus data (bad ServiceType, opcode number, or ServerId are all things I've seen), or if you're really fortunate and using a debug compile, you might be able to catch a boost instrusive list assertion or a segfault.
Take the Dispatch lock in InfRcTransport::PayloadChunk::~PayloadChunk().
Not doing so allows multiple threads to occasionally muck around inside
the transport simultaneously, leading to many bizarre errors, including
what appear to be wedged ReplicatedSegments, or servers getting requests
with totally bogus data (bad ServiceType, opcode number, or ServerId are
all things I've seen), or if you're really fortunate and using a debug
compile, you might be able to catch a boost instrusive list assertion or
a segfault.

I think this (::~PayloadChunk) is the only way that workers can directly
invoke the transport without going through some other layer (such as
WorkerSession or TranportManager) that ensures that the lock is held,
though I haven't exhaustively reviewed the code. It looks like other
transports (*Driver classes, actually) do the right thing and take the
lock.

I have no idea how we didn't run into this until now (as far as I can tell
this bug has been with us since before the SOSP submission).

jcarreira/ramcloud,jblomer/ramcloud,SMatsushi/RAMCloud,anirajk/RAMCloud,jblomer/ramcloud,QingkaiLu/RAMCloud,QingkaiLu/RAMCloud,alexandermerritt/ramcloud,y-higuchi/ramcloud,y-higuchi/ramcloud,DavidLi2010/ramcloud,jcarreira/ramcloud,utah-scs/RAMCloud,mrdiegoa/ramcloud,matrix207/RAMCloud,jblomer/ramcloud,mrdiegoa/ramcloud,utah-scs/RAMCloud,matrix207/RAMCloud,DavidLi2010/ramcloud,SMatsushi/RAMCloud,taschik/ramcloud,jcarreira/ramcloud,QingkaiLu/RAMCloud,QingkaiLu/RAMCloud,taschik/ramcloud,jcarreira/ramcloud,SMatsushi/RAMCloud,utah-scs/RAMCloud,taschik/ramcloud,behnamm/cs244b_project,DavidLi2010/ramcloud,anirajk/RAMCloud,rstutsman/RAMCloud,behnamm/cs244b_project,DavidLi2010/ramcloud,IMCG/RamCloud,Frank-Wu/RamCloud,jblomer/ramcloud,mrdiegoa/ramcloud,rstutsman/RAMCloud,behnamm/cs244b_project,jcarreira/ramcloud,DavidLi2010/ramcloud,matrix207/RAMCloud,Frank-Wu/RamCloud,anirajk/RAMCloud,taschik/ramcloud,behnamm/cs244b_project,jblomer/ramcloud,IMCG/RamCloud,matrix207/RAMCloud,mrdiegoa/ramcloud,rstutsman/RAMCloud,rstutsman/RAMCloud,matrix207/RAMCloud,rstutsman/RAMCloud,anirajk/RAMCloud,SMatsushi/RAMCloud,SMatsushi/RAMCloud,y-higuchi/ramcloud,y-higuchi/ramcloud,Frank-Wu/RamCloud,utah-scs/RAMCloud,mrdiegoa/ramcloud,DavidLi2010/ramcloud,IMCG/RamCloud,jblomer/ramcloud,behnamm/cs244b_project,IMCG/RamCloud,alexandermerritt/ramcloud,y-higuchi/ramcloud,utah-scs/RAMCloud,taschik/ramcloud,y-higuchi/ramcloud,mrdiegoa/ramcloud,IMCG/RamCloud,QingkaiLu/RAMCloud,matrix207/RAMCloud,anirajk/RAMCloud,alexandermerritt/ramcloud,IMCG/RamCloud,behnamm/cs244b_project,anirajk/RAMCloud,utah-scs/RAMCloud,Frank-Wu/RamCloud,rstutsman/RAMCloud,SMatsushi/RAMCloud,alexandermerritt/ramcloud,alexandermerritt/ramcloud,Frank-Wu/RamCloud,alexandermerritt/ramcloud,Frank-Wu/RamCloud,QingkaiLu/RAMCloud,jcarreira/ramcloud