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

[Hl7.Fhir.STU3 v3.8.3] FhirClient interprets FhirClientSettings.Timeout milliseconds as seconds #2994

Open
joelleloving opened this issue Dec 10, 2024 · 0 comments

Comments

@joelleloving
Copy link

joelleloving commented Dec 10, 2024

FhirClient incorrectly interprets FhirClientSettings.Timeout milliseconds as seconds, when HTTP Timeout value is set.

The defect is in the HttpClientRequester constructor, which incorrectly uses the 4-param TimeSpan constructor (public TimeSpan (int days, int hours, int minutes, int seconds)). FhirClientSettings.Timeout is in milliseconds (as documented, and as indicated by the default value of 100000), but is passed into the seconds param. Presumably the intent was to use the 5-param constructor, of which the 5th param is milliseconds.

	public HttpClientRequester(Uri baseUrl, FhirClientSettings settings, HttpMessageHandler messageHandler, bool disposeHandler = true)
	{
                ...
		Client.Timeout = new TimeSpan(0, 0, 0, Settings.Timeout);
	}

This defect can result in incredibly long (e.g., 16+ hour when Timeout is set to 60s) hang times when the network drops, as HttpClient gets stuck waiting to timeout. Temporary network outages cause processing to entirely halt (presumably for 16 hours 40 minutes in our case, though we have never actually waited that long).

Version used:

  • FHIR Version: STU3
  • Version: 3.8.3

Clearly, this is a very old version (we are currently working through some issues to get upgraded, but will be on 3.x for the near future). But it seems severe/simple enough that a fix might be of interest. At the very least, documenting seems useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant