[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?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 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

Generated at Thu Feb 08 09:03:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.