Obtain a read lock on connection info before logging command.

This commit is contained in:
Kelvin Mwinuka
2024-07-01 05:47:18 +08:00
parent a102f90bc0
commit d31cb10b51
2 changed files with 1991 additions and 6622 deletions

View File

@@ -174,7 +174,9 @@ func (server *EchoVault) handleCommand(ctx context.Context, message []byte, conn
}
if internal.IsWriteCommand(command, subCommand) && !replay {
server.connInfo.mut.RLock()
server.aofEngine.LogCommand(server.connInfo.tcpClients[conn].Database, message)
server.connInfo.mut.RUnlock()
}
server.stateMutationInProgress.Store(false)