[X] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
NettyRemotingClient uses the Timer task scheduler to close and clear client-related connections, because the timer #scheduleAtFixedRate(java.util.TimerTask, long, long) method is used. When the server time changes, the tasks of the scheduler will be executed together. For example, the startup time of the service is 2022. After the startup is completed, the server synchronizes the latest time through the network to 2023, and the tasks that should be executed separately in 2022 and 2023 will be executed together. When they will also start to relevant ClientHouseKeepingService thread CPU usage will be very high.
Motivation
I want to know why timer#scheduleAtFixedRate() is used as a task instead of timer#schedule (). Timer#schedule() postpones the delayed task by the set time. Rather than the scheduleAtFixedRate method directly together execution.
Describe the Solution You'd Like
Hopefully, when the service starts, even if the time changes, it shouldn't cause cpu spikes.
Describe Alternatives You've Considered
Can use timer#schedule () instead of timer#scheduleAtFixedRate() or another task scheduler.
Finding that #6116 has replaced java.util.Timer with netty's HashedWheelTimer, using HashedWheelTimer to execute the delayed task, there is no problem described above.
Before Creating the Enhancement Request
Summary
NettyRemotingClient
uses the Timer task scheduler to close and clear client-related connections, because thetimer #scheduleAtFixedRate(java.util.TimerTask, long, long)
method is used. When the server time changes, the tasks of the scheduler will be executed together. For example, the startup time of the service is 2022. After the startup is completed, the server synchronizes the latest time through the network to 2023, and the tasks that should be executed separately in 2022 and 2023 will be executed together. When they will also start to relevant ClientHouseKeepingService thread CPU usage will be very high.Motivation
I want to know why
timer#scheduleAtFixedRate()
is used as a task instead oftimer#schedule ()
.Timer#schedule()
postpones the delayed task by the set time. Rather than the scheduleAtFixedRate method directly together execution.Describe the Solution You'd Like
Hopefully, when the service starts, even if the time changes, it shouldn't cause cpu spikes.
Describe Alternatives You've Considered
Can use timer#schedule () instead of timer#scheduleAtFixedRate() or another task scheduler.
Additional Context
No response