Skip to content

为什么brpc框架内部大部分计时都没有使用 MONOTONIC,是有性能或其他方面的考虑吗? #2763

Description

@synckey

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

brpc 中的很多超时和唤醒逻辑都使用了墙上时钟,在系统时钟跳变时会产生很多问题。

比如以下代码:

请求超时时间:https://github.com/apache/brpc/blob/master/src/brpc/channel.cpp#L552

条件变量等待时间:https://github.com/apache/brpc/blob/master/src/bthread/condition_variable.h#L75

sleep时间:https://github.com/apache/brpc/blob/master/src/bthread/task_group.cpp#L775

Describe the solution you'd like (描述你期望的解决方法)

切换成 monotonic clock ?

Describe alternatives you've considered (描述你想到的折衷方案)
No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimprovements on existing features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions