MaxMind-DB-Reader-java
MaxMind-DB-Reader-java copied to clipboard
Unsafe memory access operation
Did read through the same error that occurred before, https://github.com/maxmind/MaxMind-DB-Reader-java/issues/81. We are using File Mode as memory mapped. The issue shows up on one of the containers and it fails some calls while passes few.
org.springframework.web.util.NestedServletException: Async processing failed; nested exception is java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod$ConcurrentResultHandlerMethod.lambda$new$0(ServletInvocableHandlerMethod.java:223) at java.base/jdk.internal.reflect.GeneratedMethodAccessor312.invoke(Unknown Source)
Does not look like underlying file was not loaded properly, else no request should have been successful after the failure. Any pointers or the reasoning behind why it occurs and sustains on one of the containers. Was the file reference not correct? but if thats the case none of the requests to resolve ip would have been successful.
For now we had to restart the container to fix the issue.
Is it possible something is modifying the file after it opens, e.g., is the database being updated? Is the file on a network file system or something like that?
The file is on EFS and we are just reading from the file. There are no writes. We do replace the file once a week but we are using atomic reference to load it into memory and re-initializing the readers when the file is replaced.
I am not sure there is much we can do about this. Although it isn't clear exactly what led up to the issue, internal Java errors like this are a risk of using memory mapping. I am going to close this, but I am happy to reopen if there is something that is actionable.