OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
130 stars 169 forks source link

Provide configuration option to disable source connection checks #2359

Closed anthonysena closed 5 months ago

anthonysena commented 7 months ago

The following line of code will attempt to check the connection to a configured data source upon startup:

https://github.com/OHDSI/WebAPI/blob/d90d653d1449affd8ef272141cf0af59e635b115/src/main/java/org/ohdsi/webapi/source/SourceService.java#L108

This is problematic for data sources, such as DataBricks, where the database server takes time to activate upon first query which results in WebAPI hanging until the DataBricks environment starts up. We'd like to be able to control this behavior through configuration - either overall for the WebAPI deployment or on an individual data source level.

ganisimov commented 6 months ago

@anthonysena @fdefalco I'm looking into this one and going to prepare a PR. Please, let me know in case of concerns or additional requirements. I'm going to add the flag to skip connection check both on deployment and individual data source level. Data source level setting has a precedence over deployment level. This covers simple cases and allows fine tuning with minimum effort in terms of configuration.

anthonysena commented 6 months ago

Thanks @ganisimov - it is probably cleaner to just have this setting on the data source and not on the deployment. Presumably you'll have a flyway migration that adds a new column for the data source connection check and we'd have it default to "true" and then we can optionally turn it off where needed.

So please ignore my suggestion of having an application-level configuration for this setting.