You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExceptionMapper is accessed from multiple request threads but the underlying Map is a HashMap; could be refactored to use a ConcurrentHashMap or methods could be made synchronized
The text was updated successfully, but these errors were encountered:
I can't claim to be very knowledgeable about the inner workings of Spark, but from a quick read of the sources, I think this is not necessarily a big problem. The exception mappings are done in SparkInstance.exception(), which is synchronized (and AFAIK, multiple instances are not intended to be used). MatcherFilter accesses the mappings without synchronization, but in a read-only fashion. As long as exceptions are mapped before SparkInstance.init()is called, we're good - of course, nothing prevents users from adding routes or filters before exception mappings, which could cause a race condition. I guess the solution would be to either synchronize access (or use a concurrent map) or require that exceptions are not mapped after initialization.
ExceptionMapper is accessed from multiple request threads but the underlying Map is a HashMap; could be refactored to use a ConcurrentHashMap or methods could be made synchronized
The text was updated successfully, but these errors were encountered: