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

Provide configuration option to disable source connection checks #2359

Closed
anthonysena opened this issue Apr 9, 2024 · 2 comments · Fixed by #2374
Closed

Provide configuration option to disable source connection checks #2359

anthonysena opened this issue Apr 9, 2024 · 2 comments · Fixed by #2374
Milestone

Comments

@anthonysena
Copy link
Collaborator

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

jdbcTemplate.execute(SqlTranslate.translateSql("select 1;", source.getSourceDialect()).replaceAll(";$", ""));

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.

@anthonysena anthonysena added this to the v2.15 milestone Apr 9, 2024
@ganisimov
Copy link
Contributor

@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
Copy link
Collaborator Author

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.

ganisimov pushed a commit to ganisimov/WebAPI that referenced this issue May 23, 2024
chrisknoll pushed a commit that referenced this issue May 23, 2024
@anthonysena anthonysena linked a pull request May 28, 2024 that will close this issue
ganisimov pushed a commit to ganisimov/WebAPI that referenced this issue Jul 26, 2024
anthonysena pushed a commit that referenced this issue Jul 30, 2024
* Add check_connection flag to SourceRequest

Related to #2359

* Fix putting constant on left side of equality operator

---------

Co-authored-by: Gennadiy Anisimov <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants