HBASE-20895 NPE in RpcServer#readAndProcess

Synchronize readAndProcess() on the Connection to avoid MT issues with
data buffer management
This commit is contained in:
Andrew Purtell 2018-07-27 18:07:58 -07:00
parent 203a3324e9
commit 2d70120eb3
1 changed files with 1 additions and 1 deletions

View File

@ -1635,7 +1635,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver {
* @throws IOException
* @throws InterruptedException
*/
public int readAndProcess() throws IOException, InterruptedException {
public synchronized int readAndProcess() throws IOException, InterruptedException {
// If we have not read the connection setup preamble, look to see if that is on the wire.
if (!connectionPreambleRead) {
int count = readPreamble();