Skip to content

[Bug] Hidden bugs in MetricsEventBus #15295

@PengJingzhao

Description

@PengJingzhao

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.3

Steps to reproduce this issue

While researching Dubbo's EventBus mechanism today, I discovered some hidden bugs in the code. Therefore, I am proposing fixes as follows:

  • No null-check for the event object itself, which may lead to a NullPointerException

Image

  • No type validation using instanceof before performing type casting.

Image

  • tryInvoke is a public method and is called frequently, but it lacks a null-check for the runnable object.

Image

What you expected to happen

Improve null-check operations and type validation. Of course, I am happy to submit a PR to complete this work.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions