CyberSource / cybersource-rest-client-dotnetstandard

.NET Standard client library for the CyberSource REST API
7 stars 15 forks source link

Timeout setting in Configuration file is being ignored #53

Closed wehnertb closed 4 months ago

wehnertb commented 1 year ago

I have dropped my Timeout to "5000" and I am still seeing calls taking 1.67 MINUTES before they finally cancel.

I am using a merchantkey and merchantid to authenticate and on top of seeing an awful lot of timeouts lately, I'm also seeing a lot of "authentication" errors. I retry three times when I get a timeout - the pattern seems to be timeout, timeout, authentication failure.

Is there something else besides setting the timeout in the config do we need to do to have the SDK cancel the request if the timeout is reached?

The endpoint I'm posting to is: https://api.cybersource.com/pts/v2/payments/###############/captures (where "##############" is the Authorizaton ID I need to capture.

On top of this, I am not seeing these requests show up in the Transaction Management portal at all. These requests are for a US account on servers running in the US.

wehnertb commented 1 year ago

OK - looks like the offending code is here https://github.com/CyberSource/cybersource-rest-client-dotnetstandard/blob/master/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/Configuration.cs

You take a dictionary of values for the configuration and your examples explicitly show putting the timeout in this dictionary, however, you do not look at the dictionary to see if that value was set and set the timeout accordingly.

gnongsie commented 1 year ago

Hi @wehnertb,

The dictionary is being used in the Authentication SDK where it is used to populate a Configuration object with the required properties for the underlying HTTP Client. Refer to the line

However, this behavior is very concerning. Can you provide me with an example when this happened? As in a timestamp, along with the corresponding identifying values, so that I can check the logs on our end?

Please send it across to gnongsie@visa.com