surrealdb / surrealist

Surrealist is the ultimate way to visually manage your SurrealDB database
https://surrealist.app/
MIT License
1.1k stars 84 forks source link

Error when fetching large responses #81

Closed 0xMimir closed 1 year ago

0xMimir commented 1 year ago

Describe the bug I have table tickers with million plus, tickers, for different symbols, periods, exchanges, when trying to query:

select * from tickers where symbol = 
$symbol and period = $period and exchange = $exchange

with variables:

{
    "symbol": "FIL-USDT",
    "period": "day",
    "exchange": "kucoin"
}

following query should return about 1000 rows, but response in GUI shows

Request timed out

But in console I get

index.c14cda9d.js:77 No callback for message {"id":"3QSfGO8","result":[{"time":"26.805522845s","status":"OK","result":[{"asset":"FIL","buy_pair":"USDT","close":"5.298800000000000","exchange":"kucoin","high":"5.517800000000000","id":"tickers:01pp60ml04vdchkpnknq","low":"5.427600000000000","open":"5.389700000000000","period":"day","source":"cryptodata","symbol":"FIL-USDT","unix":1667174400,"volume":"327346.6083000000"},
...
{"asset":"FIL","buy_pair":"USDT","close":"4.4188","exchange":"kucoin","high":"4.42","id":"tickers:0k2ole993jppqv14bmle","low":"4.4188","open":"4.42","p
(anonymous) @ index.c14cda9d.js:77 Show more (241 kB) Copy

And data in there shows response

Edit: When running query with smaller result but same response time:

select count() from tickers where symbol = 
$symbol and period = $period and exchange = $exchange group count

same problem still shows, but in network tab at browser in rpc messages I see query getting sent and response:

{"id":"IIi3Kla","result":[{"time":"4.84780071s","status":"OK","result":[{"count":891}]}]}

To Reproduce Steps to reproduce the behavior:

  1. Make query with large response and look at console log

Expected behavior I think this is problem with timeout somewhere, because frontend still receives the correct response, but it doesn't handle it properly

Environment (you can view the current version under Settings):

macjuul commented 1 year ago

Have you tried increasing the Query timeout in the settings?

0xMimir commented 1 year ago

I have tried to increase timeout settings, it doesn't help

macjuul commented 1 year ago

Does "Request timed out" appear instantly or after the configured Query timeout has passed? And does the request in the network tab complete before or after the UI displays request timed out?

0xMimir commented 1 year ago

it appears randomly, i have set timeout to 10000 seconds, and timeout error appears around 30-60 seconds

macjuul commented 1 year ago

Alright, are you using the latest 1.7.5 nightly release by any chance?

0xMimir commented 1 year ago

I am building on release branch

macjuul commented 1 year ago

I'm not sure what you mean by building on release branch, are you using this exact release?

0xMimir commented 1 year ago

I was using code that was on release branch. I don't see it anymore

0xMimir commented 1 year ago

When running on latest main branch, build passes and problem doesn't accur