Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: $batch requests fails #565

Open
1 task done
ikalachy opened this issue Oct 1, 2024 · 0 comments
Open
1 task done

[Bug]: $batch requests fails #565

ikalachy opened this issue Oct 1, 2024 · 0 comments
Labels
bug Something isn't working needs triage This issue needs to be investigated and confirmed as a valid

Comments

@ikalachy
Copy link
Contributor

ikalachy commented Oct 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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

@ikalachy ikalachy added bug Something isn't working needs triage This issue needs to be investigated and confirmed as a valid labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage This issue needs to be investigated and confirmed as a valid
Projects
None yet
Development

No branches or pull requests

1 participant