Skip to content

Conversation

navinvishy
Copy link

What is the purpose of the change

Currently for a fractional value for memory size, like 1.5g, the exception message is generated from failing to parse the string ".5g". Improving the exception handling for this case.

Verifying this change

Added a change in MemorySizeTest to make sure this is handled as expected.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Currently for a fractional value for memory size, like 1.5g, the exception message is generated from failing
to parse the string ".5g". Improving the exception handling for this case.
@flinkbot
Copy link
Collaborator

flinkbot commented Sep 27, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

throw new NumberFormatException("text does not start with a number");
}

if(unit.startsWith(".")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest changing this to test the valid characters allowed - maybe with one or more regex's. I assume the unit should be 1 or more digits followed by a supported unit characters.

Copy link
Author

Choose a reason for hiding this comment

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

Yes the unit is 1 or more digits followed by unit. I have changed this to use a regex. Could you take another look? Thanks!

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-reviewed PR has been reviewed by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants