I have 2 Sessions
Session 100
Session 101
Both retrieve data from a database via API Call.
But they request different Rows.
It happens that the database do an update and some rows aren't available to call.
If sessions 100 success with response HTTP 200 and session 101 HTTP 404 the protocol script works normal
If sessions 101 success with response HTTP 200 and session 100 HTTP 404 the protocol script goes to a timeout (Orange message appears)
I even check if the response HTTP 200 try to parse the data and show them in a table. If not write in the Logs: HTTP 404 server maybe not reachable
I don't know why
Thanks in advance
Hi Ömer,
This most likely has to do with the element timeout settings which is set by default to 30s.
If there are no valid responses (2XX status) being received for more than 30s after a failed response is received, the element will go into timeout. This mechanism activates the timeout state + alarm to indicate that the communication towards the device is experiencing problems.
Implementing HTTP communication | DataMiner Docs
In your example, because the last session being executed returns with a 404 response status, the element will eventually go into timeout if there are no new requests being executed which do return with a valid status.
If the first session returns a 404 status but the next one immediately after returns a 200 status, the element notices the communication is still working and won't go into a timeout state.
To avoid the element going into timeout because of this session, there are a few options:
- Ignore timeouts for this particular HTTP session within the connector if it's expected that this particular session can regularly receive a faulty status.
ignoreTimeout attribute | DataMiner Docs - Ensure that there is a request/response being executed on a frequent basis which returns the 2XX status. This will prevent the element going into the timeout state if there are other sessions being executed OK.
- Under the element settings in Cube, increase the default timeout time from 30s to something higher.
- Under the element settings in Cube, uncheck the 'Include timeout' option under the HTTP Connection tab. This ensures the element never goes into timeout if there is a faulty response for this Connection.
Hope this information helps!
Thank you for u answer
I restructured my code and putted all sessions in 1 group and posted a new question
https://community.dataminer.services/question/how-to-time-sessions/
Thanks for the explanation
I checked the timeout settings I have, the same as you
only if the first session success, it never starts a timeout
but if the first session fails even the 2nd session has an HTTP 200 it goes to a timeout
for debugging, I print the status code for each session
the 2nd session has HTTP 200 (and fills the table with data) and the first 404 session says: “nothing found, wait for the next API call”
after 10 min (timer triggers new API Calls)
the timeout is gone for 30 sec and comes back