Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request start and end parameter to sleep runner #491

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

VijayanB
Copy link
Member

Description

Worker coordinator expects every runner to have request start and request end key.
Added client request start and client request end before and after sleep.

Issues Resolved

#485

Testing

  • New functionality includes testing

[Describe how this change was tested]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Worker coordinator expects every runner to have request start
and request end key.
Added client request start and client request end before and
after sleep.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@saimedhi
Copy link
Contributor

@VijayanB, Have you tested if this issue is resolved with this fix?

@VijayanB
Copy link
Member Author

@VijayanB, Have you tested if this issue is resolved with this fix?

@saimedhi Yeah, it worked locally for my test procedure.

@IanHoang IanHoang added the 1.5.0 label Mar 28, 2024
@VijayanB
Copy link
Member Author

VijayanB commented Apr 2, 2024

@gkamat @IanHoang Any update on this?

@IanHoang
Copy link
Collaborator

IanHoang commented Apr 5, 2024

@saimedhi @VijayanB are there any other runners that require similar changes?

Copy link
Collaborator

@IanHoang IanHoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If there are any other issues that require similar changes, we should create an issue to keep track of them and close them out.

@IanHoang IanHoang merged commit a20f467 into opensearch-project:main Apr 5, 2024
8 checks passed
@Kyle-sandeman-mrdfood
Copy link

Good day

I can open an Issue if this is not the right place to report a regression.
Side note: I am not familiar with this repo, but #450 seems to have a change related to this PR.

With a simple setup of OSB 1.6.0 and this added to my existing test_procedures->schedule:

{
  "operation": {"operation-type": "sleep", "duration": 1.5}
}

I am getting (after my other operations and after the sleep completes):

2024-06-18 14:22:26,790 ActorAddr-(T|:63310)/PID:58826 osbenchmark.worker_coordinator.worker_coordinator INFO Choosing [unthrottled] for [sleep].
2024-06-18 14:22:26,790 ActorAddr-(T|:63310)/PID:58826 osbenchmark.worker_coordinator.worker_coordinator INFO Creating iteration-count based schedule with [None] distribution for [sleep] with [0] warmup iterations and [1] iterations.
2024-06-18 14:22:26,790 ActorAddr-(T|:63310)/PID:58826 osbenchmark.worker_coordinator.worker_coordinator INFO iteration-count-based schedule will determine when the schedule for [sleep] terminates.
2024-06-18 14:22:28,292 ActorAddr-(T|:63310)/PID:58826 osbenchmark.worker_coordinator.worker_coordinator ERROR Could not execute schedule
Traceback (most recent call last):

  File "/Users/kylesandeman/.benchmark/venv/lib/python3.11/site-packages/osbenchmark/worker_coordinator/worker_coordinator.py", line 1592, in __call__
    request_start = request_context.request_start
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/kylesandeman/.benchmark/venv/lib/python3.11/site-packages/osbenchmark/client.py", line 54, in request_start
    return self.ctx["request_start"]
           ~~~~~~~~^^^^^^^^^^^^^^^^^

KeyError: 'request_start'

Changing the Sleep Runner code to do the on_client_request_start first seems to fix it.
The code in #450 seems to require you to call this function first....

    async def __call__(self, opensearch, params):
        sleep_duration = mandatory(params, "duration", "sleep")
        try:
            request_context_holder.on_client_request_start()
            opensearch.on_request_start()
            await asyncio.sleep(sleep_duration)
        finally:
            opensearch.on_request_end()
            request_context_holder.on_client_request_end()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants