Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-1241

Duplicate error response on HTTPConnector timeouts.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 1.3.0.Final
    • 1.2.9.Final
    • Gateway, Gateway API
    • None
    • Hide
      apiman-gateway.connector-factory.http.timeouts.read=2
      apiman-gateway.connector-factory.http.timeouts.write=2
      
      Show
      apiman-gateway.connector-factory.http.timeouts.read=2 apiman-gateway.connector-factory.http.timeouts.write=2

    Description

      I have found that if the HTTPConnector times out without receiving the response from the backend API, then somewhere down the line it generates 2 error responses and this is evident from the metrics as it show 2 failures as supposed to 1 failure for the single request.

      So there are 2 issues,

      • firstly the returned error response contains 2 error XMLs appended to each other and sent to the browser and hence not a valid XML.
      • The metrics also shows as 2 failure response for single request.

      This can be easily simulated by setting very low timeouts (for ex: 2 secs) in apiman.properties.

      apiman-gateway.connector-factory.http.timeouts.read=2
      apiman-gateway.connector-factory.http.timeouts.write=2
      
      XML Parsing Error: junk after document element
      Location: ...
      Line Number 1, Column 131:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><engineErrorResponse><responseCode>500</responseCode></engineErrorResponse><?xml version="1.0" encoding="UTF-8" standalone="yes"?><engineErrorResponse><message>io.apiman.gateway.engine.beans.exceptions.ConnectorException: timeout</message><responseCode>500</responseCode></engineErrorResponse>
      ----------------------------------------------------------------------------------------------------------------------------------^
      

      Attachments

        Activity

          People

            msavy_jira Marc Savy (Inactive)
            sbalu27 Balu Sadhasivam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: