Browse Source

Fix data race between event processing and session when concurrent goroutines are potentially accessing schema details or creating, altering keyspaces and tables.

Ghislain 'Aus' Lacroix 8 years ago
parent
commit
3b79a4f810
1 changed files with 3 additions and 0 deletions
  1. 3 0
      events.go

+ 3 - 0
events.go

@@ -106,6 +106,9 @@ func (s *Session) handleEvent(framer *framer) {
 }
 
 func (s *Session) handleSchemaEvent(frames []frame) {
+	s.mu.RLock()
+	defer s.mu.RUnlock()
+
 	if s.schemaDescriber == nil {
 		return
 	}