Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#74 Concurrent mod exception when sending many uploads to server

Fedora 3.0b2
closed
nobody
None
9
2008-09-15
2008-07-10
Chris Wilper
No

On Thu, Jul 10, 2008 at 5:37 AM, Antony Corfield [awc] <awc@aber.ac.uk> wrote:
> Hi, I've been running some tests depositing zip files using SWORD. When I hit the server with 50 concurrent threads (unlikely in reality!) I get the following error in the fedora code.
>
> java.util.ConcurrentModificationException
> at java.util.Hashtable$Enumerator.next(Hashtable.java:1031)
> at fedora.server.management.DefaultManagement.putTempStream(DefaultManagement.java:1395)
> at fedora.server.management.UploadServlet.saveAndGetId(UploadServlet.java:149)
> at fedora.server.management.UploadServlet.doPost(UploadServlet.java:99)
>
>
> Here's a simple patch (Fedora 3.0b1) for fedora.server.management.UploadServlet that fixes this problem.
> Same problem in Fedora 2.2.1 and other versions I guess.
>
>
>
>
> Index: C:/Users/awc/eclipse/fedora_release-3.0b1/src/java/fedora/server/management/UploadServlet.java
> ===================================================================
> --- C:/Users/awc/eclipse/fedora_release-3.0b1/src/java/fedora/server/management/UploadServlet.java (revision 6592)
> +++ C:/Users/awc/eclipse/fedora_release-3.0b1/src/java/fedora/server/management/UploadServlet.java (working copy)
> @@ -129,8 +129,10 @@
> }
>
> private String saveAndGetId(Context context, FilePart filePart)
> - throws ServerException, IOException {
> - return s_management.putTempStream(context, filePart.getInputStream());
> + throws ServerException, IOException {
> + synchronized (s_management) {
> + return s_management.putTempStream(context, filePart.getInputStream());
> + }
> }

Discussion

  • Chris Wilper
    Chris Wilper
    2008-08-26

    Logged In: YES
    user_id=189298
    Originator: YES

    We have a contrib from Christophe Brunet that addresses this in the latest code, needs review and apply

     
  • Chris Wilper
    Chris Wilper
    2008-08-26

    • priority: 7 --> 9
     
  • fcswa
    fcswa
    2008-09-15

    • status: open --> closed