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

Chain head watcher fallback #2723

Closed
wants to merge 2 commits into from
Closed

Conversation

leoyvens
Copy link
Collaborator

@leoyvens leoyvens commented Aug 19, 2021

A re-implementation of #2378, since we've again seen the chain head update stream have issues in production in heavily loaded nodes, post the tokio upgrade. Generally it seems like a good idea to be robust to the listener going down, though this will likely work differently after the block stream is pipelined. Resolves #2714.

BlockStream, BlockStreamMetrics, ChainHeadUpdateListener, ChainHeadUpdateStream,
TriggersAdapter,
};
pub use block_stream::{BlockStream, BlockStreamMetrics, ChainHeadUpdateListener, TriggersAdapter};
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I have some ide/rustfmt misconfiguration?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This wasn't just a reformat, the ChainHeadUpdateStream import was removed. And rustfmt runs on CI so you never have to worry about that.

let mut watcher = self.chain_head_update_watcher.clone();
let watcher_fut: Pin<Box<dyn Future<Output = _> + Send>> = async move {
watcher
.changed()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On further testing, because this watcher will always have an unseen change since the original chain_head_update_watcher wasn't checked for the change. This is a deadly flaw in the PR since I don't see a good way to solve this, I'll rework this fallback with a different approach.

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.

Subgraphs don't receive notifications of chain head updates so stop indexing
2 participants