Explorar el Código

Merge pull request #5293 from heyitsanthony/fix-compact-cancel-crash

etcdserver: fix nil dereference in physical Compact on proposal timeout
Gyu-Ho Lee hace 10 años
padre
commit
c9c2cdfeaf
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      etcdserver/v3_server.go

+ 1 - 1
etcdserver/v3_server.go

@@ -121,7 +121,7 @@ func isTxnSerializable(r *pb.TxnRequest) bool {
 
 func (s *EtcdServer) Compact(ctx context.Context, r *pb.CompactionRequest) (*pb.CompactionResponse, error) {
 	result, err := s.processInternalRaftRequest(ctx, pb.InternalRaftRequest{Compaction: r})
-	if r.Physical && result.physc != nil {
+	if r.Physical && result != nil && result.physc != nil {
 		<-result.physc
 		// The compaction is done deleting keys; the hash is now settled
 		// but the data is not necessarily committed. If there's a crash,