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

opt(server): Run Lua on remote thread only if it's a different thread #1684

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

chakaz
Copy link
Collaborator

@chakaz chakaz commented Aug 9, 2023

No description provided.

@chakaz chakaz requested a review from dranikpg August 9, 2023 19:30
dranikpg
dranikpg previously approved these changes Aug 9, 2023
@@ -1412,6 +1412,34 @@ const CommandId* Service::FindCmd(CmdArgList args) const {
return res;
}

namespace {
optional<ShardId> GetRemoteShardToRunAt(const Transaction& tx) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i suggest moving it to a common place with all other anonymous functions

// current shard.

ShardId sid = tx.GetUniqueShard();
if (EngineShard::tlocal() == nullptr) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

using ServerState::tlocal()->thread_index() removes this condition

@chakaz chakaz merged commit 3a832b5 into main Aug 10, 2023
10 checks passed
@chakaz chakaz deleted the remote-thread branch August 10, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants