[ 
https://issues.apache.org/jira/browse/CASSANDRA-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993682#comment-14993682
 ] 

Paulo Motta commented on CASSANDRA-7645:
----------------------------------------

The only potential problem is if we get a {{TraceUnavailable}} in the {{for 
trace future.get_all_query_traces(self.max_trace_wait)}} loop after some traces 
were already printed. In this case, we will print these traces again in the 
except block loop {{for trace_id in future.get_query_trace_ids()}}.

We could save a list of already printed {{trace_id}} and skip them in the 
except block, but  I'd prefer to have this handled driver-side, by exposing the 
{{wait_for_complete}} option in the {{get_all_query_traces}} method. So we 
could replace the whole thing with:

{noformat}
for trace in future.get_all_query_traces(self.max_trace_wait, 
wait_for_complete=False):
  if not trace.duration:
     msg = "Statement trace did not complete within %d seconds; trace data may 
be incomplete." % (self.session.max_trace_wait,)
     self.writeresult(msg, color=RED)
  print_trace(self, trace)
{noformat}

What do you think [~carlyeks] [~aholmber] ?

> cqlsh: show partial trace if incomplete after max_trace_wait
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-7645
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7645
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Tyler Hobbs
>            Assignee: Carl Yeksigian
>            Priority: Trivial
>             Fix For: 2.2.4, 2.1.12, 3.0.0
>
>
> If a trace hasn't completed within {{max_trace_wait}}, cqlsh will say the 
> trace is unavailable and not show anything.  It (and the underlying python 
> driver) determines when the trace is complete by checking if the {{duration}} 
> column in {{system_traces.sessions}} is non-null.  If {{duration}} is null 
> but we still have some trace events when the timeout is hit, cqlsh should 
> print whatever trace events we have along with a warning about it being 
> incomplete.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to