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

fix: Ensure Indexer Config Updates Are Read in Runner #384

Merged
merged 5 commits into from Nov 14, 2023
Merged

Conversation

darunrs
Copy link
Collaborator

@darunrs darunrs commented Nov 12, 2023

Runner sets Indexer Config when the thread is started. As a result, it does not react to updates to that config, such as updates to code. This is a problem as that means unless runner is restarted, published code changes won't be used. I've changed it so that the config is read each iteration of the loop. That way, config updates will be consumed. In the short term, this can be tuned such as reading every X loops and on every failure, if need be. In the long term, improved communication between coordinator and runner can facilitate coordinator communicating to runner to read the config as opposed to doing so all the time.

In addition, the metrics for block wait duration and overall execution duration were wrong. I've moved the start time to the correct spot.

@darunrs darunrs requested a review from a team as a code owner November 12, 2023 01:24
@darunrs darunrs changed the title Communicate Indexer Config Updates to Runner fix: Ensure Indexer Config Updates Are Read in Runner Nov 13, 2023
if (isHistorical) {
METRICS.LAST_PROCESSED_BLOCK_HEIGHT.labels({ indexer: indexerName, type: workerContext.streamType }).set(block.blockHeight);
}
METRICS.LAST_PROCESSED_BLOCK_HEIGHT.labels({ indexer: indexerName, type: workerContext.streamType }).set(block.blockHeight);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this metric still needed now that we use UNPROCESSED_STREAM_MESSAGES to calculate BPS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually kept it in for a different thing I planned to tackle. We have alarms for social feed lag that still point to V1. Those are constantly firing. But, that did remind me that we probably want to have a last processed block metric for indexers so that we can use them for alarming for production indexers. I haven't researched it yet, but I figure if its already in grafana, getting an alarm set up shouldn't be too hard.

const functions = {
let indexerConfig = await workerContext.redisClient.getStreamStorage(streamKey);
let indexerName = `${indexerConfig.account_id}/${indexerConfig.function_name}`;
let functions = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't need to be defined in this scope, or necessarily be mutable. Should we move the declaration to the assignment below?

@darunrs darunrs merged commit 01ede89 into main Nov 14, 2023
5 checks passed
@darunrs darunrs deleted the fixPreFetch branch November 14, 2023 00:58
@morgsmccauley morgsmccauley mentioned this pull request Nov 20, 2023
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.

None yet

2 participants