XiaoMi / ozhera

Application Observable Platform in the Cloud Native Era
https://ozhera.m.one.mi.com
Apache License 2.0
60 stars 28 forks source link

The last row timestamp may be invisible to multiple threads #318

Closed littlepangdi closed 3 months ago

littlepangdi commented 3 months ago

In our case, log-agent will hold this last line and not sending it for several days(far more than the default ten minutes), which results in alarm delays.

The may causing by following variables which are not marked with the volatile keyword may not be updated correctly in multi-threaded scenarios.

https://github.com/XiaoMi/ozhera/blob/c4dd93856da577c5ccfc1af48170cd9a0b64f8ae/ozhera-log/log-agent/src/main/java/com/xiaomi/mone/log/agent/channel/ChannelServiceImpl.java#L96

wtt40122 commented 3 months ago

ok,there is indeed this issue. You can raise a PR and I will help you with it