TenKeyAngle / dataturbine

Automatically exported from code.google.com/p/dataturbine
1 stars 0 forks source link

Rapidly Opening / Closing Archives Fails #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start a server
2. Create a source.  Set its ring buffer to cache = 5, "append", 500.
3. In a tight loop, open the server, put one data point, then Detach the 
connection, 50 times.
4. Open a sink connection and request all the data.

What is the expected output? What do you see instead?
One would expect to get all 50 points.  Instead one sees 10 points.  The 
other data is lost.

If you restart the server and reload the archive, you will observe the 
following exception:

java.lang.IllegalStateException: Channels in ring buffer 2 conflict with 
those in 1.
        at com.rbnb.api.RBO.readFromArchive(RBO.java:5050)
        at com.rbnb.api.RBO.setUpArchiveAndCache(RBO.java:6743)
        at com.rbnb.api.RBO.setUpRingBuffer(RBO.java:6969)
        at com.rbnb.api.RBO.doConnect(RBO.java:2202)
        at com.rbnb.api.RBO.run(RBO.java:6002)
        at java.lang.Thread.run(Thread.java:619)

Note: putting 1 second sleeps in the loop did not change the result in any 
way.

Original issue reported on code.google.com by enfield....@gmail.com on 25 Mar 2008 at 1:41

Attachments:

GoogleCodeExporter commented 9 years ago
The design of the server limits the number of archive files to the square root 
of 
the number of archives.  By closing the source at each step, the each file in 
the 
archive was forced to a size of 1 frame, reducing the total capacity.  Because 
it is 
inherant in the design of the server this will not be fixed at this time.

One bug that was fixed was a potential loss of data when Flush() is used 
rapidly 
with Detach() without synchronizing; now the Source synchronizes with the 
server on 
Close/Detach preventing data loss.  A deadlock that occurred with requests when 
the 
server lost data in this manner was also corrected.

Original comment by enfield....@gmail.com on 27 Mar 2008 at 8:01