sometimes the XHR are in pending state and then ar...
# community-help
a
sometimes the XHR are in pending state and then are canceled once the timeout is reached
j
That sounds like the network request are timing out, and then the adapter retries the requests. Could you copy-as-curl one of the failing network requests and paste it here?
a
Hi Jason, to debug the issue I started
mitmweb
in reverse proxy mode, when the XHR req is ok I see that request listed in the mitmweb console, while if the XHR req is in pending state (I set 10s as timeout) I don't see it in mitmweb
the cURL request is:
Copy code
curl '<http://localhost:8080/multi_search?x-typesense-api-key=sample>' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,es;q=0.6' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: text/plain' \
  -H 'Origin: <http://localhost:1234>' \
  -H 'Referer: <http://localhost:1234/>' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-site' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36' \
  -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --data-raw '{"searches":[{"query_by":"title,shape,color,vendor,gender,productType","facet_by":"vendor,gender,productType","sort_by":"","highlight_full_fields":"title,shape,color,vendor,gender,productType","collection":"my_collection","q":"to","max_facet_values":10,"page":1,"per_page":16}]}' \
  --compressed
I used the
searchBox
InstantSearch.js widget
whenever I see the XHR requests canceled I also noticed a slowliness of the stats.json service (about 20 sec)
j
Could you do a GET
<http://localhost:8080/health>
and see if that returns healthy?
Could you also check that there's sufficient RAM allocated and swap is not being used?
a
yes, "health" service returns
Copy code
{
  "ok": true
}
htop reports about 196MB used over 443 MB of RAM
j
and swap usage?
a
is zero
j
Hmm, does restarting the Typesense process help?
a
I still didn't tried to restart
do you recommend to restart it periodically ?
j
No you shouldn't have to... Just trying to get to the bottom of this particular issue
May I know what version of Typesense server this is?
a
0.22.0
j
IIRC we had an issue related to imports that could exhaust all available resources and cause hanging behavior like this...
So this might be a bug. I'd recommend upgrading to at least 0.22.2 if not 0.23.1
a
ok thank you so much !
👍 1
Hi Jason, I'm sorry to bother you, just a quick follow-up about the issue I had last day. It turned out it was caused by a misconfiguration of ELB. Typesense both version 0.22.0 and 0.23.1 are perfectly fine! Thank you!
👍 1
😅 1