Skip to content

Do not use PostConstruct for config validation#25048

Merged
losipiuk merged 2 commits intotrinodb:masterfrom
losipiuk:lukaszos/do-not-use-postconstruct-for-config-validation-100b84
Feb 17, 2025
Merged

Do not use PostConstruct for config validation#25048
losipiuk merged 2 commits intotrinodb:masterfrom
losipiuk:lukaszos/do-not-use-postconstruct-for-config-validation-100b84

Conversation

@losipiuk
Copy link
Copy Markdown
Member

Description

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 17, 2025
@losipiuk losipiuk requested a review from wendigo February 17, 2025 16:35
@github-actions github-actions bot added hive Hive connector bigquery BigQuery connector kafka Kafka connector pinot Pinot connector prometheus Prometheus connector labels Feb 17, 2025
@losipiuk losipiuk force-pushed the lukaszos/do-not-use-postconstruct-for-config-validation-100b84 branch 2 times, most recently from 24e4535 to 0c89e90 Compare February 17, 2025 16:53
@losipiuk losipiuk force-pushed the lukaszos/do-not-use-postconstruct-for-config-validation-100b84 branch from 0c89e90 to 6ab9d3d Compare February 17, 2025 17:11
@losipiuk losipiuk merged commit 0b487c9 into trinodb:master Feb 17, 2025
@github-actions github-actions bot added this to the 471 milestone Feb 17, 2025
@hashhar
Copy link
Copy Markdown
Member

hashhar commented Feb 24, 2025

Could you explain the motivation? Can we ban PostConstruct in config classes?

@wendigo
Copy link
Copy Markdown
Contributor

wendigo commented Feb 24, 2025

@hashhar we should. PostConstruct is for life cycle management when all of the dependencies are resolved correctly and graph is fully built. In this case we want to validate config which happens earlier, during graph construction and is reported differently. One will be an actionable failure (validation) and the other will not (you will get an exception from lifecycle manager)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigquery BigQuery connector cla-signed hive Hive connector kafka Kafka connector pinot Pinot connector prometheus Prometheus connector

Development

Successfully merging this pull request may close these issues.

3 participants