SebastianGruza opened a new pull request, #3216:
URL: https://github.com/apache/hugegraph/pull/3216
## Purpose of the PR
- close #3215
`GraphSpace.info()` formats the storage percentage with
`String.format("%.2f", …)` and parses it back with `Float.parseFloat`. Without
a `Locale` the format follows the JVM default locale, so on `pl_PL`, `de_DE`,
`fr_FR`, `ru_RU` and every other decimal-comma locale it yields `"0,33"`, which
`parseFloat` rejects. Since `info()` runs on every serialisation of a
`GraphSpace`, with `usePD=true` a fresh PD makes the Server exit at startup
(`Can't write json: For input string: "0,00"`), an existing PD lets it start
degraded (some graphs never load, every drop fails), and `GET
/graphspaces/{space}` answers 400.
## Main Changes
- `GraphSpace.info()` formats with `Locale.ROOT`; the arithmetic and the
two-digit rounding are unchanged.
- New `unit/core/GraphSpaceInfoLocaleTest` (in `UnitTestSuite`):
`storage_percent` is `0.33` for 33/100 under `pl_PL`, `de_DE`, `fr_FR`, `ru_RU`
and under `Locale.ROOT` and `en_US`; the default locale is restored in
`finally`.
## Verifying these changes
- [x] `GraphSpaceInfoLocaleTest` 2/2 on JDK 11.
- [x] On a 3-VM lab (1 PD + 3 Store + 1 Server from a tarball, `usePD=true`,
Server JVM started with `-Duser.language=pl -Duser.country=PL` against a PD
that already holds the DEFAULT space): master `fabe0f0b` → `GET
/graphspaces/DEFAULT` answers `400 Can't write json: For input string: "0,00"`;
this PR → 200 with the full space description. Logs in `results/f10-fix/` of
https://github.com/SebastianGruza/hugegraph-validation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]