SAP / neonbee

A reactive dataflow engine, a data stream processing framework using Vert.x
https://neonbee.io
Eclipse Public License 2.0
39 stars 17 forks source link

[Bug]: $batch requests fails #565

Open ikalachy opened 2 weeks ago

ikalachy commented 2 weeks ago

Is there an existing issue for this?

Current Behavior

if there are 2 requests in a batch, one of them fails. But if you try the request separately, it works.

http://localhost:3000/backend/odata/hcmtanalysis/$batch

--batch_id-1723558461992-81
Content-Type:application/http
Content-Transfer-Encoding:binary

GET Folders?$filter=To_Parent_id%20eq%20null HTTP/1.1
Accept:application/json;odata.metadata=minimal;IEEE754Compatible=true
Accept-Language:en-US
Content-Type:application/json;charset=UTF-8;IEEE754Compatible=true

--batch_id-1723558461992-81
Content-Type:application/http
Content-Transfer-Encoding:binary

GET Systems?$filter=To_Parent_id%20eq%20null&$expand=To_Analysis HTTP/1.1
Accept:application/json;odata.metadata=minimal;IEEE754Compatible=true
Accept-Language:en-US
Content-Type:application/json;charset=UTF-8;IEEE754Compatible=true

-batch_id-1723558461992-81-
Group ID: $auto

gives the following response:

--batch_ab94d2f4-9459-4889-a40c-38e159fab24f
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 500 Internal Server Error
OData-Version: 4.0
Content-Length: 0

--batch_ab94d2f4-9459-4889-a40c-38e159fab24f
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 200 OK
OData-Version: 4.0
Content-Type: application/json;ieee754compatible=true;odata.metadata=minimal
Content-Length: 133

{"@odata.context":"$metadata#Systems(To_Analysis())/$entity","@odata.metadataEtag":"\"157e6a8ae38e33ed5a1952cc365335c3\"","value":[]}
-batch_ab94d2f4-9459-4889-a40c-38e159fab24f-

Expected Behavior

all provided batches should be handled

Steps To Reproduce

No response

Environment

- OS:
- Java:
- NeonBee:

Relevant log output

No response

Anything else?

500 error doesn't highlight the problem with endpoint itself. It's just default value for odata response

image

I do expect the process to wait until both requests are resolved and then respond with the relevant content. However, it appears that only one of the two requests is executed, triggering a global response (batch request itself). The second request simply returns a default 500 error with empty content, which is default values for OData response object.

The problem as discussed during our committee meeting is that we reuse same processors through all batch request handling flow but should create new instance of Processor per each request.

Here is current flow where same subProcess promise is used for handle several request inside of one batch request.

image