1

I am facing a problem on restxq multiple parallel request of post, put. When request from web application as async bulk request (approx. more then 5 ). I am using exist db 5.1.0 or 5.1.1 I am sending request through angular forkjoin because of i want to submit more then 20 or 50 request in parallel

declare
%rest:path("/docs/{$doc-id}")
%rest:PUT("{$body}")
%rest:consumes("application/json")
%output:method("json")
function doc-rx:update-docs($doc-id as xs:string, $body) {
  try{
    let $request:= parse-json(util:binary-to-string( $body))
    return
   <result>Success</result>
  }catch * {
   <error>Caught error {$err:description}</error>
 }
};

Some request will failed with below message, some request got cancelled

Failed Message: The underlying InputStream has been closed. Unable to encode string value: The underlying InputStream has been closed Some Request got cancelled.

Please advise how can I resolve this issue.

  • Hi @danesh-gayari this looks like a bug report rather than a StackOverflow question. Could you open an issue on our bug-tracker - https://github.com/exist-db/exist/issues The most important thing is to help us reproduce your problem, can you provide the simplest possible example RESTXQ xquery and details of how to trigger the problem (even if it is a bash script with curl and gnu parallel) – adamretter Jan 23 '20 at 10:21
  • Hi @adamretter, I am working on angular web application with exist rest, – Dinesh Gayari Jan 24 '20 at 07:15
  • Hi @adamretter, I am working on angular web application with exist rest. fiirst time i got this issue when submitted parallel 20 post request through above mention code. in body part i submitted file as a base64encode in json format. but later on i found any request put or post submitted in parallel more then 20 or 50 request with forkjoin in angular. that time some request failed or cancelled with above failed message – Dinesh Gayari Jan 24 '20 at 07:24
  • put Request: http://localhost:8080/exist/restxq/docs/10001 body part: { "size":"123", "name": "abc.pdf" } One more thing it will not come every time it will occur frequently – Dinesh Gayari Jan 24 '20 at 07:59

0 Answers0