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

Reduce RPC cost of oscar by removing unnecessary tasks #2597

Merged
merged 5 commits into from
Dec 13, 2021

Conversation

wjsi
Copy link
Member

@wjsi wjsi commented Dec 2, 2021

What do these changes do?

Reduce RPC cost of oscar by removing unnecessary tasks. Now Oscar can handle 4500 calls pser sec instead of 2500 before optimization.

Related issue number

Fixes #xxxx

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass, see here for how to run them

@wjsi wjsi added type: enhancement request mod: actor to be backported Indicate that the PR need to be backported to stable branch labels Dec 2, 2021
@wjsi wjsi added this to the v0.9.0a1 milestone Dec 2, 2021
Copy link
Contributor

@hekaisheng hekaisheng left a comment

Choose a reason for hiding this comment

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

LGTM, some comments are needed.

mars/oscar/backends/context.py Outdated Show resolved Hide resolved
mars/oscar/core.pyx Show resolved Hide resolved
Copy link
Contributor

@hekaisheng hekaisheng left a comment

Choose a reason for hiding this comment

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

LGTM

except asyncio.CancelledError:
try:
await self.cancel(address, message.message_id)
except CannotCancelTask:
# cancel failed, already finished
raise asyncio.CancelledError
except: # noqa: E722 # nosec # pylint: disable=bare-except
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ignore the exception?

Copy link
Member Author

@wjsi wjsi Dec 8, 2021

Choose a reason for hiding this comment

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

To make the result consistent with async.wait which does not raises. If any errors occur, await future will raise it.

Copy link
Collaborator

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

@hekaisheng hekaisheng added backported already PR has been backported and removed to be backported Indicate that the PR need to be backported to stable branch labels Dec 13, 2021
chaokunyang added a commit to chaokunyang/mars that referenced this pull request May 31, 2022
…ks (mars-project#2597)

Merge branch cherry-pick-rpc-opt-mars-project#2597 of git@gitlab.alipay-inc.com:ray-project/mars.git into master
https://code.alipay.com/ray-project/mars/pull_requests/217

Signed-off-by: 捕牛 <hejialing.hjl@antgroup.com>


* Reduce RPC cost of oscar by removing unnecessary tasks (mars-project#2597)

# Conflicts:
#	mars/deploy/oscar/session.py
#	mars/deploy/oscar/tests/test_local.py
#	mars/oscar/backends/pool.py
#	mars/oscar/backends/ray/communication.py
#	mars/services/scheduling/supervisor/assigner.py
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