Skip to content

Conversation

@ruanwenjun
Copy link
Member

Purpose of the pull request

close #17311

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@ruanwenjun ruanwenjun self-assigned this Jul 1, 2025
@ruanwenjun ruanwenjun added this to the 3.3.1 milestone Jul 1, 2025
@ruanwenjun ruanwenjun added the improvement make more easy to user or prompt friendly label Jul 1, 2025
args = null;
} else {
args = new Object[standardRpcRequest.getArgs().length];
if (!methodInvoker.isParameterTypeValidated(standardRpcRequest.getArgsTypes())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: this can happen 1 line earlier before the args assignment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (argType == null) {
continue;
}
if (parameterTypes.get(i) != argType) {
Copy link
Member

@pjfanning pjfanning Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one option here is to use https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#isAssignableFrom-java.lang.Class-

  • this would allow subclasses to be accepted
  • the current check only works if the classes are an exact match

The if would look something like:
if (parameterTypes.get(i).isAssignableFrom(argType)

This is worth testing because I have a habit of getting this check the wrong way around.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestions, thank you!

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_fixUserCanCustomRpcArgsType branch from a465d27 to 4841a30 Compare July 2, 2025 12:25
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 2, 2025

@ruanwenjun ruanwenjun changed the title [Improvement-17311][RPC] We should validate the args type in RPC method [Improvement-17311][RPC] Validate the args type in RPC method Jul 3, 2025
@SbloodyS SbloodyS requested a review from Gallardot July 7, 2025 02:01
@SbloodyS SbloodyS merged commit bcf89fe into apache:dev Jul 7, 2025
260 of 315 checks passed
eco8848 pushed a commit to eco8848/dolphinscheduler that referenced this pull request Aug 8, 2025
davidzollo pushed a commit to davidzollo/dolphinscheduler that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly priority:high test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][RPC] We should validate the args type in RPC method.

4 participants