Commit c365d376 authored by Nick Lanam's avatar Nick Lanam
Browse files

Fix sequence of state setters between cancelling one query and starting another

Summary: Removing one piece of spaghetti reveals another...

Test Plan:
Try this streaming query. It should get results and still be cancellable.
```
import px
df = px.DataFrame(table='http_events', start_time='-2s')
df.pod = df.ctx['pod']
df = df.drop(['time_', 'upid', 'trace_role', 'http_minor_version', 'http_content_type', 'http_resp_message'])
px.display(df.stream())
```

Reviewers: nserrino, michelle, #engineering, philkuz, vihang

Reviewed By: #engineering, vihang

Differential Revision: https://phab.corp.pixielabs.ai/D6709

GitOrigin-RevId: c6df9dfa5289d1a5ef159f1150e95d06856ecf9b
parent 26f4bd82
Showing with 6 additions and 2 deletions
+6 -2
......@@ -288,8 +288,12 @@ const ScriptContextProvider = (props) => {
const mutation = ContainsMutation(execArgs.pxl);
const isStreaming = IsStreaming(execArgs.pxl);
setLoading(true);
setStreaming(isStreaming);
// The cancellation above sets a timeout to mark these both as false, to get around a context update timing issue.
// In so doing, it pushes that issue downstream, to here, so do the same trick to fix it.
setTimeout(() => {
setLoading(true);
setStreaming(isStreaming);
});
if (!execArgs.skipURLUpdate) {
commitURL(execArgs.liveViewPage, execArgs.id, execArgs.args);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment