Skip to content

Commit

Permalink
Restore time measurement on request end (#1861)
Browse files Browse the repository at this point in the history
Closes #1860
  • Loading branch information
gbanasiak authored Jun 27, 2024
1 parent f72ea62 commit 18e4a2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions esrally/client/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,13 @@ async def on_request_end(session, trace_config_ctx, params):
# Rally's implementation of the `on_request_end` callback handler updates the timestamp on every call, Rally
# will ultimately record the time when it received the *last* chunk. This is what we want because any code
# that is using the Elasticsearch client library can only act on the response once it is fully received.
#
# We also keep registering for `TraceConfig.on_request_end()` instead of relying on
# `TraceConfig.on_response_chunk_received()` only to handle corner cases during client timeout when aiohttp does
# not call request exception handler, but does call request end handler. See
# https://github.com/elastic/rally/issues/1860 for details.
trace_config.on_response_chunk_received.append(on_request_end)
trace_config.on_request_end.append(on_request_end)
# ensure that we also stop the timer when a request "ends" with an exception (e.g. a timeout)
trace_config.on_request_exception.append(on_request_end)

Expand Down

0 comments on commit 18e4a2c

Please sign in to comment.