LCOGT / mop

Microlensing Observation Portal
GNU General Public License v3.0
0 stars 7 forks source link

Priority targets page gives 502 Bad Gateway error #121

Closed rachel3834 closed 9 months ago

rachel3834 commented 9 months ago

MOP's priority targets page is currently not loading, and instead resulting in a 502 Bad Gateway error.

rachel3834 commented 9 months ago

Stern logs report the following error:

mop-b46f476df-rzgnw nginx 2024/01/02 22:01:35 [error] 7#7: *5988 upstream prematurely closed connection while reading response header from upstream, client: 10.100.32.218, server: _, request: "GET /prioritytargets/ HTTP/1.1", upstream: "http://127.0.0.1:8080/prioritytargets/", host: "mop.lco.global", referrer: "https://mop.lco.global/targets/"

Jashandeep reports seeing this error when the queryset returned is very large.

rachel3834 commented 9 months ago

I've introduced a cap on the number of events that can be returned in response to the two queries performed for the priority targets page. This should ensure that the page loads before the browser timesout, and assumes a bad gateway error.

Since the returned target lists are already sorted into order of descending priority, this means we will always display the highest priority targets, but may not display some of the borderline targets if the number is high. The page also displays a warning for the user so that they know this is the case.

A better solution might be to paginate these tables.