How do you avoid response payload desieralization bug for DefaultFactHandles?

21 views
Skip to first unread message

Andrew Menning

unread,
Feb 20, 2023, 2:11:57 PM2/20/23
to Drools Usage
We have a kie-server running with one stateless server using 7.52.0.FINAL.  We are running into this known NumberFormatException for the external fact format bug.  We are hitting this bug after the deployment unit has been up and has hit ~0.5 million calls.  After this point, the response external-form DefaultFactHandle ids reach over Inteter.MAX_VALUE and cause this bug.  In the response payload, it is unable to deserialize the fact section of the response.  Here is an example response fact handle that cannot be deserialized in version 7.52.0.FINAL due to the number after the first colon (2187933256)

"org.drools.core.common.DefaultFactHandle": {
"external-form": "0:2187933256:1187933256:-1057688150:2690:DEFAULT:NON_TRAIT:FakeFact"
}  

It looks like this bug was only fixed in version 8.x or later.  How can we avoid this bug in 7.x?  Is the only way to reset the fact counter by stopping and restarting the deployment unit?    Alternatively, we don't use the fact handles returned by ruleServicesClient.executeCommandsWithResults, is there a way to prevent the fact handle list being returned in the response payload?

Here is an example JSON call 
{
    "lookup": "StatelessSession",
    "commands": [
        {
            "insert": {
                "object": {
                    "FakeFact": {
                        "primaryId": 33472,
                        "field1": "testField"
                    }
                },
                "out-identifier": "FakeFact",
                "return-object": false,
                "entry-point": "DEFAULT",
                "disconnected": false
            }
        },
        {
            "start-process": {
                "processId": "process-id",
                "data": null,
                "parameter": [],
                "out-identifier": null
            }
        },
        {
            "get-objects": {
                "class-object-filter": null,
                "out-identifier": "outResultIdentifier"
            }
        }
    ]
}

Toshiya Kobayashi

unread,
Feb 20, 2023, 10:27:15 PM2/20/23
to Drools Usage
> It looks like this bug was only fixed in version 8.x or later.  How can we avoid this bug in 7.x?  

Unfortunately, we don't have an immediate plan to release 7.74. However, you can build a patch using the commit (https://github.com/kiegroup/drools/commit/6ff2f12ab11187c1cf46f0ca84ced1edc85f883b) on top of your version (e.g. 7.52.0.Final). It's only drool-core.jar so you can replace drool-core-7.52.0.Final.jar with your patched jar on both server-side and client-side.


> Alternatively, we don't use the fact handles returned by ruleServicesClient.executeCommandsWithResults, is there a way to prevent the fact handle list being returned in the response payload?

AFAIK, there is no option to prevent the fact handle list.

Regards,
Toshiya

2023年2月21日火曜日 4:11:57 UTC+9 Andrew Menning:
Reply all
Reply to author
Forward
0 new messages