Skip to content

Commit 09d857c

Browse files
author
Sean Sullivan
committed
Catch errors higher in the stack and serve error instead of causing the client to retry. The retry was causing the workers to get restarted before valid requests could complete
1 parent a14aa7d commit 09d857c

File tree

1 file changed

+5
-1
lines changed
  • elastic_datashader/routers

1 file changed

+5
-1
lines changed

elastic_datashader/routers/tms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
from ..config import config
2727
from ..drawing import generate_x_tile
28-
from ..elastic import get_es_headers
28+
from ..elastic import get_es_headers,get_search_base
2929
from ..logger import logger
3030
from ..parameters import extract_parameters, merge_generated_parameters
3131
from ..tilegen import (
@@ -294,6 +294,10 @@ async def fetch_or_render_tile(already_waited: int, idx: str, x: int, y: int, z:
294294
# Get hash and parameters
295295
try:
296296
parameter_hash, params = extract_parameters(request.headers, request.query_params)
297+
# try to build the dsl object bad filters cause exceptions that are then retried.
298+
# underlying elasticsearch_dsl doesn't support the elasticsearch 8 api yet so this causes requests to thrash
299+
# If the filters are bad or elasticsearch_dsl cannot build the request will never be completed so serve X tile
300+
get_search_base(config.elastic_hosts,request.headers,params,idx)
297301
except Exception as ex: # pylint: disable=W0703
298302
logger.exception("Error while extracting parameters")
299303
params = {"user": request.headers.get("es-security-runas-user", None)}

0 commit comments

Comments
 (0)