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

support client timeout #2267

Merged
merged 6 commits into from
Apr 25, 2023
Merged

support client timeout #2267

merged 6 commits into from
Apr 25, 2023

Conversation

lxning
Copy link
Collaborator

@lxning lxning commented Apr 23, 2023

Description

Please read our CONTRIBUTING.md prior to creating your first pull request.

Please include a summary of the feature or issue being fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

  • support parameter "clientTimeoutInMills" in model config yaml file.
  • drop an inference request processing if it is expired on client side.
  • drop an inference request's response if the request is expired on client side.

Fixes #(issue)
#1863

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A
    Logs for Test A

  • Test B
    Logs for Test B

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@lxning lxning self-assigned this Apr 23, 2023
@lxning lxning added the enhancement New feature or request label Apr 23, 2023
@lxning lxning added this to the v0.8.0 milestone Apr 23, 2023
@codecov
Copy link

codecov bot commented Apr 23, 2023

Codecov Report

Merging #2267 (f9dffb9) into master (49a7993) will not change coverage.
The diff coverage is n/a.

❗ Current head f9dffb9 differs from pull request most recent head 295c0f0. Consider uploading reports for the commit 295c0f0 to get more accurate results

@@           Coverage Diff           @@
##           master    #2267   +/-   ##
=======================================
  Coverage   69.82%   69.82%           
=======================================
  Files          77       77           
  Lines        3420     3420           
  Branches       57       57           
=======================================
  Hits         2388     2388           
  Misses       1029     1029           
  Partials        3        3           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lxning lxning requested a review from msaroufim April 24, 2023 17:55
* the client timeout in millions second. The inference request will be dropped once it is
* timeout.
*/
private long clientTimeoutInMills;
Copy link
Member

@msaroufim msaroufim Apr 24, 2023

Choose a reason for hiding this comment

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

is default value infinity?

EDIT: browsed further seems like yes

Copy link
Collaborator Author

@lxning lxning Apr 24, 2023

Choose a reason for hiding this comment

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

default is 0 so that setClientExpireTS of RequestInput.java can be easily calculated (ie. clientExpireTS will be infinity).

inferChannel.writeAndFlush(req);
TestUtils.getLatch().await(1, TimeUnit.SECONDS);
Assert.assertNull(TestUtils.result);

Copy link
Member

Choose a reason for hiding this comment

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

what's the expected returned error code?

Copy link
Collaborator Author

@lxning lxning Apr 24, 2023

Choose a reason for hiding this comment

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

nothing is returned if client already timeout. The inference request will be dropped and warning is logged.

@@ -281,7 +283,13 @@ public void pollBatch(String threadId, long waitTime, Map<String, Job> jobsRepo)
}
maxDelay -= end - begin;
begin = end;
jobsRepo.put(j.getJobId(), j);
if (j.getPayload().getClientExpireTS() > System.currentTimeMillis()) {
jobsRepo.put(j.getJobId(), j);
Copy link
Member

Choose a reason for hiding this comment

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

Is the client timeout w.r.t to a single inference example or a single batch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

timeout is applied on each inference request.

@msaroufim msaroufim self-requested a review April 24, 2023 23:26
@lxning lxning merged commit 542385e into master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants