-
Notifications
You must be signed in to change notification settings - Fork 1k
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
IndexInput.isLoaded seems to return false for mmap index inputs on Windows #14050
Comments
Here is an example build failure: These only happen on Uwe's machine but can be reproduced on any Windows machine. |
Right. Seems like it's always false on Windows. |
While the test can be fixed easily (bypass the check on Windows), I wonder if it's a good fix. In essence, this method lies on Windows... What are the side-effects of this always returning false? |
The method returns |
Yep, I think I understand the reason it returns Optional - a missing value would indicate "don't know", so it's a tri-state knob: yes, no, don't know. The problem is that on Windows it returns "no" and that logic in BaseDirectoryTest assumes that if it's a mmapdir, it should always be a hard "true". |
yeah, i'm suggesting adding this to the code:
|
This was my initial guess too. But if we hardcode it and then they fix the JDK with some magic Windows API that returns the right value? Should we try to detect if isLoaded returns true on Windows and return the detected value? |
It seems the commented-out code with hardcoded I am not sure it needs a magic windows API, just looks like maybe the wrong one (VirtualQuery) was attempted instead of e.g. |
the |
At least not everywhere: |
I've peeked at the flags returned by QueryWorkingSetEx - just wondering if it'd be possible to query it directly using ffi. :) But I can't tell which of these flags would correspond to the loaded/ swapped out state. Fun. https://learn.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-psapi_working_set_ex_block But I agree - reporting back to JDK is probably a saner idea, I'm sure they have better win32 api experts there. |
I think it won't return flags at all in that case. |
I don't have access to openjdk's Jira, maybe @ChrisHegarty or Uwe (or you?) can file an issue there? |
Oops! Sorry, clearly I added this test and didn't noticed it fail on Windows. For Lucene, I'm perfectly fine with returning "don't know" for all Windows. Lemme look into why this is not working in the JDK. It would be good to ensure that there is an issue open for this in the OpenJDK JIRA, but I'm less inclined to spend much time trying to make it work in Lucene until it is fixed in the JDK. |
Thanks, Chris. The only Windows tests running at the moment are on Uwe's vbox. Github's Windows testing is so slow as to be almost unusable. The results from Uwe's box are sent to this list - |
Hi,
Not sure if the test needs to be adapted. |
Description
There is a check added to BaseDirectoryTest case in #13998 which has been failing since that PR was merged (nearly all Windows builds failing on jenkins):
The isLoaded optional has a value of false, even though it is a mmap directory. Seems like isLoaded in MemorySegment always returns false on Windows?
Version and environment details
No response
The text was updated successfully, but these errors were encountered: