Skip to content

Retry GET from Redis for messages in the Execution Graph - #181

Merged
csegarragonz merged 3 commits into
masterfrom
redis-get-retry
Nov 30, 2021
Merged

Retry GET from Redis for messages in the Execution Graph#181
csegarragonz merged 3 commits into
masterfrom
redis-get-retry

Conversation

@csegarragonz

@csegarragonz csegarragonz commented Nov 25, 2021

Copy link
Copy Markdown
Collaborator

In this PR I fix a race condition that happened when running Scheduler::getFunctionExecGraph() immediately after Scheduler::getFunctionResult() in a distributed setting.

In particular, we sometimes generated the execution graph before all remote executors had published their resulting message. As a consequence, redis.get would return an empty byte array, and we'd cast it to an empty faabric::Message.

I add a naive retry mechanism (bear in mind generating execution graphs is off the hot path), and a test that reproduces the failure with very little retries (in fact 10 tries might be an overkill).

@csegarragonz csegarragonz added the bug Something isn't working label Nov 25, 2021
@csegarragonz csegarragonz self-assigned this Nov 25, 2021
Comment thread src/scheduler/Scheduler.cpp Outdated
Comment thread src/scheduler/Scheduler.cpp
REQUIRE(node.msg.id() == req->mutable_messages()->at(i).id());
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test isn't checking that it will fail when the max retries are hit, which seems like the easier case to check for.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I add another test that checks that you can't get an execution graph for a message that hasn't been published.

@csegarragonz
csegarragonz merged commit dba98f1 into master Nov 30, 2021
@csegarragonz
csegarragonz deleted the redis-get-retry branch November 30, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants