
Long running query stability and performance improvements
Some mostly silent work to make long running queries work better, especially with weak internet.
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
Alrighty. Uh, I got a couple little ones. Um, and I figure I will start with um, one of the things that has bugged a lot of folks in the past is um, this error that sometimes pops up um, failed to fetch when you're running queries. Um, there's other places where it shows up. Basically what happens is that um we're issuing a request to Omni servers and your network has a hiccup or something and we don't recover from it.
Um and one of the places that's u a little bit more susceptible to it is when you're running a long query cuz it's taking a while and the request is open for a little bit and um wanted to try to put in something that would help mitigate that scenario. So based on the way our query API works um we can actually kind of recover from it pretty well.
Um, so what happens here is I got a query that runs for a thousand seconds. I can run it. What I'm going to do is I'm actually going to block one of the requests that's coming through from my browser here uh temporarily and we'll see it um we'll see it fail and fail a couple of times which normally would show up the failed the fetch message.
But what will happen is that I will reenable it before it fails enough times and it should um recover and allow it to continue. Now it also runs for 1,000 seconds. So I'm not going to make everyone wait for that. So um we'll kind of see how things go. But I can come in and say wait this I'm going to block the wait request.
This is the next one that comes in. Um so after about 10 seconds that will start to happen and we'll start to see u over here it start to fail. I unblocked it. We can see we have a successful one that's going now. In about 30 seconds later um it will kick off the next wait request. Um, obviously this is kind of a silly demo, but uh hopefully it should help folks have u a little bit better experience u sort of running long queries in slightly less than ideal network scenarios.
Um the other thing that it does is that if the browser detects that your computer is offline, it will wait even a little longer um and and sort of wait until the browser decides that it comes back online. It's really hard to show that when I'm connecting to my local machine and I'm also trying to um uh showcase to folks uh over the internet also.
But I can turn off I can basically tell the browser to pretend it's offline and if I'm not careful here like I think it's the 30 second expiration here. It will fail but I can then turn it like back online um and it will recover and do the right thing. It's a little bit silly because I'm not actually canceling that request because it's not real because I'm just throttling it.
But in any case, hopefully this makes the experience a little bit better. Um, and also if it sort of fails and you disconnect and it manages to like sort of catch it, if you like close your laptop or whatever, it will ideally, and I have yet to actually see this happen based off of the timing of everything, but like if it reconnects and it says, "Oh, I'm still alive.
I'm still in my like polling loop, whatever. I will attempt to um it will issue one more wait request and get that say the query behind the scenes actually completed or actually failed behind the scenes. So hopefully that just makes the experience a little bit better. I'm not going to like wait for this thing to query to complete so I'm going to kill it.
Um the other is I