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

bugfix collector can not auto reconnect when channel idle #1259

Merged
merged 4 commits into from
Sep 24, 2023
Merged

Conversation

tomsun28
Copy link
Contributor

What's changed?

bugfix collector can not auto reconnect when channel idle

Checklist

  • I hereby agree to the terms of the HertzBeat CLA
  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

try {
ClusterMsg.Message heartbeat = ClusterMsg.Message.newBuilder()
.setIdentity(identity)
.setType(ClusterMsg.MessageType.HEARTBEAT)
Copy link
Contributor

Choose a reason for hiding this comment

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

发消息最好把Request加上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的 setDirection(ClusterMsg.Direction.REQUEST)

CollectServer.this.sendMsg(heartbeat);
log.info("collector send cluster server heartbeat, time: {}.", System.currentTimeMillis());
} catch (Exception e) {
log.error(e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

这里log日志弄的详细一点把

@@ -66,7 +66,7 @@ private void init(final SchedulerProperties schedulerProperties, final CommonThr
this.remotingServer.registerHook(Lists.newArrayList(new NettyHook() {
@Override
public void doBeforeRequest(ChannelHandlerContext ctx, ClusterMsg.Message message) {
ManageServer.this.clientChannelTable.put(message.getIdentity(), ctx.channel());
// do something before processor list
Copy link
Contributor

Choose a reason for hiding this comment

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

去了的话直接删了好了,hook不用加了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好 那接口还是留着以后用

@@ -138,7 +138,7 @@ private void initChannel(final SocketChannel channel) {
pipeline.addLast(new ProtobufVarint32LengthFieldPrepender());
pipeline.addLast(new ProtobufEncoder());
// idle state
pipeline.addLast(new IdleStateHandler(0, 0, 30));
pipeline.addLast(new IdleStateHandler(0, 0, 100));
Copy link
Contributor

Choose a reason for hiding this comment

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

放到ServerConfig里面怎么样?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants