Przeglądaj źródła

avoid SIGSEGV by not tracing unless query is trace enabled (#940)

* don't trace unless query is trace enabled

When 'nodetool settraceprobability' is used,
it's possible to get a response with trace information
even though client did not specifically mark the query
for tracing.

* added myself as an author
Krishnanand Thommandra 8 lat temu
rodzic
commit
88748c7b29
2 zmienionych plików z 2 dodań i 1 usunięć
  1. 1 0
      AUTHORS
  2. 1 1
      conn.go

+ 1 - 0
AUTHORS

@@ -90,3 +90,4 @@ Leigh McCulloch <leigh@leighmcculloch.com>
 Ron Kuris <swcafe@gmail.com>
 Raphael Gavache <raphael.gavache@gmail.com>
 Yasser Abdolmaleki <yasser@yasser.ca>
+Krishnanand Thommandra <devtkrishna@gmail.com>

+ 1 - 1
conn.go

@@ -845,7 +845,7 @@ func (c *Conn) executeQuery(qry *Query) *Iter {
 		return &Iter{err: err}
 	}
 
-	if len(framer.traceID) > 0 {
+	if len(framer.traceID) > 0 && qry.trace != nil {
 		qry.trace.Trace(framer.traceID)
 	}