[JAVA-4864] Ensure client metadata is computed at runtime with GraalVM native images Created: 01/Feb/23 Updated: 28/Oct/23 Resolved: 09/Feb/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Native Images |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Maxim Katcharov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | graalvm | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
ClientMetadataHelper initialize the metadata document in a static initializer. But we don't want the metadata (which includes environment variable lookups) to be based on the build environment, but rather the run-time environment. We should either ensure that class is initialized at runtime using native-image.properties or else initialize the metadata document lazily at runtime. The latter may be preferable as there is a risk that we rename/refactor this class in the future and don't notice that we need to change the native-image.properties file. |
| Comments |
| Comment by Maxim Katcharov [ 09/Feb/23 ] |
|
Fixed and manually tested as part of https://jira.mongodb.org/browse/JAVA-4856 |