RFR: 8325621: Improve jspawnhelper version checks

Aleksey Shipilev shade at openjdk.org
Mon Mar 11 18:44:09 UTC 2024


On Mon, 11 Mar 2024 18:16:53 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> If you really want to require an exact match for jspawnhelper, then these 4 numbers aren't necessarily enough, but a rather arbitrarily chosen approximation.

I think for our purposes, a version number quadruplet is enough to provide basic level of safety for jspawnhelper protocol updates across JDK versions, without version checking code being a safety problem itself. 

Putting in the full version string would raise more questions, at least for me. For example, are we guaranteed that version string always fits the argument line? Probably so. Would we get some interesting (Unicode?) symbols in version string that would break somewhere along the way? Would we need to dynamically allocate the buffer for arguments, instead of allocating enough to hold the version _integers_? Would we make a mistake while doing so? Etc.

All in all, it feels better to silently accept some version mismatches not captured by the version quadruplet, rather than fail trying to do a perfect match.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18204#issuecomment-1989179598


More information about the core-libs-dev mailing list