[ 
https://issues.apache.org/jira/browse/WICKET-3910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Király updated WICKET-3910:
----------------------------------

    Attachment: fix-WICKET-3910.patch

Attaching a fix.

This is a timing issue in the AsynchronousDataStore (and I only had the luck 
that the two different jdk produced different timing in my env).

It seems that if the following happens the error is raised:
- SaveRunnable passes file to datastore (dataStore.storeData...)
- SaveRunnable puts file on the read1 queue (filesToRead1.add...)
- Read1Runnable reads the file from its queue
- Read1Runnable tries to get the data for the file from the dataSource but gets 
null, because the asynch thread for saving the data in the datastore is 
currently running so it is not on the asynch work queue anymore and the data is 
still not in the underlying datastore either.

So the fix adds a Set to Asynch data store to track all waiting, running 
runnables in one place.

> o.a.w.page.persistent.disk.DiskDataStoreTest fails with JDK6 but passes with 
> JDK5
> ---------------------------------------------------------------------------------
>
>                 Key: WICKET-3910
>                 URL: https://issues.apache.org/jira/browse/WICKET-3910
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>         Environment: Hostspot 1.6.0_26, 1.5.0_22
>            Reporter: Attila Király
>         Attachments: fix-WICKET-3910.patch, modify-test-WICKET-3910.patch
>
>
> I am running "mvn clean package" on the command line and based on the jdk I 
> get different results (reproducable).
> With jdk6 the test fails and the following is logged:
> ERROR - DiskDataStoreTest          - data[] should never be null
> ERROR - DiskDataStoreTest          - Detected error number: 1
> ERROR - DiskDataStoreTest          - data[] should never be null
> ERROR - DiskDataStoreTest          - Detected error number: 2
> Exception in thread "Thread-22" java.lang.NullPointerException
>       at 
> org.apache.wicket.page.persistent.disk.DiskDataStoreTest$Read1Runnable.run(DiskDataStoreTest.java:231)
>       at java.lang.Thread.run(Thread.java:662)
> Exception in thread "Thread-42" java.lang.NullPointerException
>       at 
> org.apache.wicket.page.persistent.disk.DiskDataStoreTest$Read2Runnable.run(DiskDataStoreTest.java:264)
>       at java.lang.Thread.run(Thread.java:662)
> With jdk5 everything goes fine and above message is not logged.
> The datastore in the test is returning null in the Read1Runnable and 
> Read2Runnable which is causing the NPE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to