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: Unsubscribe required on exit #6103

Merged
merged 1 commit into from
Aug 17, 2023
Merged

fix: Unsubscribe required on exit #6103

merged 1 commit into from
Aug 17, 2023

Conversation

simlecode
Copy link
Collaborator

@simlecode simlecode commented Aug 17, 2023

关联的Issues (Related Issues)

改动 (Proposed Changes)

这两处退出时没有取消订阅,这样会导致同步卡住:

https://github.com/filecoin-project/venus/blob/master/pkg/chain/store.go#L706https://github.com/filecoin-project/venus/blob/master/pkg/chain/store.go#L713

附注 (Additional Info)

日志:

2023-08-16T17:22:30.357+0800	INFO	chain.store	chain/store.go:545	SetHead { bafy2bzacea6lern2svj7b56e37h43gijg5xde2kaufsqxe4yrf3x3cbdpyl6e } 3129045
2023-08-16T17:22:30.358+0800	INFO	chainsync.syncer	syncer/syncer.go:263	handle tipset height 3129045, count 1, took 0.1558(s)
2023-08-16T17:22:30.358+0800	ERROR	chain.store	chain/store.go:712	closing head change subscription due to slow reader

2023-08-16T17:38:00.227+0800	INFO	consensus	consensus/block_validator.go:142	block validation	{"took": 0.063988209, "height": "3129076", "block": "bafy2bzaceavo5dysax2deig4mpqxhbeqzgxfxi4v3t3swqbx3pcuvomnot4rs", "age": 0.227459898}
2023-08-16T17:38:00.229+0800	INFO	chain.store	chain/store.go:545	SetHead { bafy2bzaceavo5dysax2deig4mpqxhbeqzgxfxi4v3t3swqbx3pcuvomnot4rs } 3129076

从日志上看在 3129045 高度,chainnotify 退出了,然后同步卡在 3129076,相差 31 个高度,与 chainnotify 的 channel buffer(32) 容量接近。

venus-0817.log.tar.gz

自查清单 (Checklist)

在你认为本 PR 满足被审阅的标准之前,需要确保 / Before you mark the PR ready for review, please make sure that:

  • 符合Venus项目管理规范中关于PR的相关标准 / The PR follows the PR standards set out in the Venus project management guidelines
  • 具有清晰明确的commit message / All commits have a clear commit message.
  • 包含相关的的测试用例或者不需要新增测试用例 / This PR has tests for new functionality or change in behaviour or not need to add new tests.
  • 存在兼容性问题(接口, 配置,数据,灰度),如果存在需要进行文档说明 / This PR has compatibility issues (API, Configuration, Data, GrayRelease), if so, need to be documented.
  • 包含相关的的指南以及文档或者不需要新增文档 / This PR has updated usage guidelines and documentation or not need
  • 通过必要的检查项 / All checks are green

@codecov-commenter
Copy link

Codecov Report

Merging #6103 (5f219aa) into master (254a9cb) will decrease coverage by 1%.
The diff coverage is 83%.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #6103   +/-   ##
======================================
- Coverage      24%     24%   -1%     
======================================
  Files         662     662           
  Lines       80383   80389    +6     
======================================
- Hits        19700   19685   -15     
- Misses      58075   58091   +16     
- Partials     2608    2613    +5     

Copy link
Collaborator

@LinZexiao LinZexiao left a comment

Choose a reason for hiding this comment

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

LGTM

@LinZexiao LinZexiao merged commit 5449ecc into master Aug 17, 2023
@LinZexiao LinZexiao deleted the fix/not-unsubscribe branch August 17, 2023 08:06
@simlecode simlecode self-assigned this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants