Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add java.time to list of allowed reflective accesses #69

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

wilcoxjay
Copy link
Contributor

Discovered from a student reporting spurious --checks warning about fast cloning and ClientWorker:

Objects cannot be fast-cloned. Check that they don't contain lambdas or other non-standard fields. This error could also occur due to the use of a data structure the fast-cloning library does not yet support.
- class dslabs.framework.testing.ClientWorker ...

Tracked it down by unswallowing the underlying exception to discover:

java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.time.Instant.MIN_SECOND accessible: module java.base does not "opens java.time" to unnamed module.

This pointed to an "illegal" reflective access.

Adding another --add-opens fixes it, but we need to add it in three places:

  • staff facing IntelliJ run configuration
  • student facing IntelliJ run configuration
  • (student-facing) run-tests.py

I believe this was introduced in the recent refactor of ClientWorker to support better timing information, using java.time.Instant as a field, which we had apparently never used in dslabs before (or at least not in a place that the cloning library needed to touch).

There is a separate question of why we are even trying to clone that Instant (either it's a run test, in which case we shouldn't be cloning nodes, or it's a search test, in which case we shouldn't be looking at the clock at all), but I'm ignoring that for now.

@emichael emichael merged commit a2f9c03 into emichael:master Jan 31, 2024
5 checks passed
@wilcoxjay wilcoxjay deleted the reflect-time branch January 31, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants