-
Notifications
You must be signed in to change notification settings - Fork 519
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
Add new health check for improper behavior #3818
Add new health check for improper behavior #3818
Conversation
src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionManager.cs
Fixed
Show fixed
Hide fixed
src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionManager.cs
Fixed
Show fixed
Hide fixed
src/Microsoft.Health.Fhir.Api/Features/Health/ImproperBehaviorHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.Core/Features/Health/ImproperBehaviorNotification.cs
Outdated
Show resolved
Hide resolved
} | ||
|
||
public async Task Handle(StorageInitializedNotification notification, CancellationToken cancellationToken) | ||
{ | ||
_logger.LogInformation("SearchParameterDefinitionManager: Storage initialized"); | ||
await EnsureInitializedAsync(cancellationToken); | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try adding a retry logic?
Maybe a 3 times retry, otherwise set it as unhealthy?
catch | ||
{ | ||
_initialized = false; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause Note
catch (Exception ex) | ||
{ | ||
_logger.LogError(ex, $"Error calculating search parameter hash. Retry {retry}"); | ||
retry++; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause Note
catch (Exception ex) | ||
{ | ||
_logger.LogError(ex, $"Error initializing search parameters. Retry {retry}"); | ||
retry++; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause Note
private readonly IMediator _mediator = Substitute.For<IMediator>(); | ||
private readonly RequestContextAccessor<IFhirRequestContext> _fhirRequestContextAccessor = Substitute.For<RequestContextAccessor<IFhirRequestContext>>(); | ||
private readonly SqlQueueClient _sqlQueueClient; | ||
private int _maximumSupportedSchemaVersion; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private readonly RequestContextAccessor<IFhirRequestContext> _fhirRequestContextAccessor = Substitute.For<RequestContextAccessor<IFhirRequestContext>>(); | ||
private readonly SqlQueueClient _sqlQueueClient; | ||
private int _maximumSupportedSchemaVersion; | ||
private string _databaseName; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private SearchParameterDefinitionManager _searchParameterDefinitionManager; | ||
private SupportedSearchParameterDefinitionManager _supportedSearchParameterDefinitionManager; | ||
private SearchParameterStatusManager _searchParameterStatusManager; | ||
private IMediator _mediator = Substitute.For<IMediator>(); |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private SupportedSearchParameterDefinitionManager _supportedSearchParameterDefinitionManager; | ||
private SearchParameterStatusManager _searchParameterStatusManager; | ||
private IMediator _mediator = Substitute.For<IMediator>(); | ||
private RequestContextAccessor<IFhirRequestContext> _fhirRequestContextAccessor = Substitute.For<RequestContextAccessor<IFhirRequestContext>>(); |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private IMediator _mediator = Substitute.For<IMediator>(); | ||
private RequestContextAccessor<IFhirRequestContext> _fhirRequestContextAccessor = Substitute.For<RequestContextAccessor<IFhirRequestContext>>(); | ||
private SqlQueueClient _sqlQueueClient; | ||
private string _initialConnectionString; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private RequestContextAccessor<IFhirRequestContext> _fhirRequestContextAccessor = Substitute.For<RequestContextAccessor<IFhirRequestContext>>(); | ||
private SqlQueueClient _sqlQueueClient; | ||
private string _initialConnectionString; | ||
private IOptions<CoreFeatureConfiguration> _options; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
...crosoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlServerFhirStorageTestsFixture.cs
Dismissed
Show dismissed
Hide dismissed
|
||
namespace Microsoft.Health.Fhir.Core.Exceptions | ||
{ | ||
public class InitializationException : Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this inherit from FhirException?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so because it isn't related to FHIR, it is related to the server startup.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Add new health check for improper behavior.
Related issues
Addresses Bug 119273: Sort tests failing in Cosmos DB
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch