From 3d3f41b961a85b03bcd21129620f0e747c72e06e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 12 May 2020 20:20:57 +0300 Subject: [PATCH] app/vmstorage/transport: fix panic during server stop on 32-bit arches See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/212 --- app/vmstorage/transport/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/vmstorage/transport/server.go b/app/vmstorage/transport/server.go index 28be0fecb0..29f26a030a 100644 --- a/app/vmstorage/transport/server.go +++ b/app/vmstorage/transport/server.go @@ -30,6 +30,10 @@ var ( // Server processes connections from vminsert and vmselect. type Server struct { + // Move stopFlag to the top of the struct in order to fix atomic access to it on 32-bit arches. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/212 + stopFlag uint64 + storage *storage.Storage vminsertLN net.Listener @@ -40,8 +44,6 @@ type Server struct { vminsertConnsMap connsMap vmselectConnsMap connsMap - - stopFlag uint64 } type connsMap struct {