timewalker74 / ffmq

FFMQ - full-java, light-weight, fast JMS 1.1 queuer implementation
GNU Lesser General Public License v3.0
63 stars 16 forks source link

Allocation table is full #3

Closed jowerner closed 2 years ago

jowerner commented 5 years ago

Hi! I'm using FFMQ4 v4.0.6. Lately I found log entries similar to the following in the server log:

111652 ERROR [LocalSession]{TcpPacketReceiver[server]} error={DATA_STORE_ERROR} Allocation table is full (2000 blocks)
112215 ERROR [LocalSession]{TcpPacketReceiver[server]} error={DATA_STORE_ERROR} Allocation table is full (3000 blocks) 

Here are the relevant queue properties:

persistentStore.blockSize=4096
persistentStore.initialBlockCount=1000
persistentStore.maxBlockCount=1000000
persistentStore.autoExtendAmount=1000

If I understand these values correctly, the queue starts with a size of 4 MB and may increase its size up to 4 GB in 4 MB increments. However, the corresponding queue data file was nowhere near this upper limit when those error entries were logged.

Could you please help me understand what is going on here? What might cause those log entries? Did I misconfigure the queue or did I hit an internal limit? Thanks!

Please note as well that in this situation the JMS client did not get notified that the message could not be stored at the server. No exception was logged at the client.

jowerner commented 5 years ago

Looks like this issue is somehow related to larger messages. In my case it happens that messages can reach a size of several MB. Note that I reconfigured FFMQ for a large-enough maximum packet size.

With larger messages the issue is reproducible on my machine using one of the FFMQ unit tests. I simply added these methods to net.timewalker.ffmq4.test.storage.data.impl.BlockBasedDataStoreTest:

    public void testHugeMessages_OK() throws Exception
    {
        System.out.println("--------- testHugeMessages_OK ---------");
        doTest(4096, 20, 2_000_000);
    }

    public void testHugeMessages_FAIL() throws Exception
    {
        System.out.println("--------- testHugeMessages_FAIL ---------");
        doTest(4096, 1, 3_000_000);
    }

Maybe this helps analyzing this problem.

jowerner commented 5 years ago

After playing a little with the doTest() parameters, I believe that this error occurs whenever the queue was enlarged (once) by autoExtendAmount blocks and the message still does not fit into the queue.

timewalker74 commented 3 years ago

Better late than never ... Your analysis was spot on, will be fixed in version 4.0.11