Skip to content

Commit

Permalink
avoid SIGSEGV by not tracing unless query is trace enabled (apache#940)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kthommandra authored and Zariel committed Jul 17, 2017
1 parent bb83efe commit 88748c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 88748c7

Please sign in to comment.