Opened 15 years ago
Closed 15 years ago
#160 closed defect (fixed)
CSW server sometimes gives ConcurrentModificationException
Reported by: | simonp | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | v2.4.1 |
Component: | General | Version: | v2.5.0 |
Keywords: | Cc: |
Description
Reported by James Q Wilson (james.q.wilson@…): I've been trying to do some load tests on geonetwork 2_4_1 csw getRecords service and I am getting java.util.ConcurrentModificationExceptions thrown by Jeeves. What I've done is loaded up 1000 test records onto the server, and written a simple python client to sequentially fire CSW GetRecords queries at the server, asking for a randomly generated bounding box. For a single client, the server can handle ~ 60 requests / second. If I fire up multiple instances of the client I occasionally get a java.util.ConcurrentModificationException error thrown and the client quits. I've spent some time looking through the code, and the error is thrown somewhere within CatalogDispatcher.java. Although I doubt a production server would be hit this hard, it does cause some concern. Are there other subtle concurrency bugs out there waiting to bite, that have an effect on data integrity, for example. The obvious (and painful) fix is to make the app single threaded, by synchronising the whole servlet (ie synchronize Jeeves doGet doPost). Of course, this introduces significant latency when the server gets loaded. Has anyone else seen errors of this type or does anybody have suggestions as to how they could be tracked down - I don't have much expertise in concurrency issues.
Change History (2)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Further analysis: src/org/fao/geonet/services/main/CswDispatcher.java was opening Dbms resource explicitly to create new SettingManager rather than using the one provided in the context via gc.getSettingManager.
Switch to using setting manager from context fixes the problem - no need to synchronize hsListeners set in jeeves (although this behaviour is interesting!).
Fixed in svn commit 5373
This did not appear in the backported CSW 2.0.2 implementation because the service change that uses the settingmanager to check whether the CSW service was on had not been backported!
Or to put it more clearly: I've tested it and it doesn't happen when hsListeners in DbmsPool.java is synchronized. But more analysis is required.
Simon Pigot wrote: