alibaba / alibaba/Sentinel

MetricWriter has a bug that may not have an index file

Open
#796 4 comments 0 reactions 0 assignees View on GitHub
area/logging kind/bug
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## 问题描述
MetricWriter存在隐含bug
MetricWriter构造函数中将lastSecond初始化为当前时间戳,如果在同一时间戳调用write函数写入log,走下面的分支,可能出现没有写索引文件的bug:
![image](https://user-images.githubusercontent.com/18189443/58524059-7453ce80-81f9-11e9-95c0-50ca9563eb75.png)

Contributor guide

Open the contributing guide

Research direction

Locate MetricWriter and inspect its constructor and write path, especially the branch reached when both use the same timestamp. Reproduce that call sequence and verify whether the expected index file is created; done means the same-timestamp write no longer leaves the log without an index file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.