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

[BI-2450]BrAPI Server DB connections exhausted on biapi startup caching #444

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

davedrp
Copy link
Contributor

@davedrp davedrp commented Feb 17, 2025

BI-2450 - BrAPI Server DB connections exhausted on biapi startup caching

Description

The scheduled delay in creating the cache from the DOA's is now driven by the .env file. That way the expensive calls to the BrAPI server (that are called when bi-api is first started). can be staggered. The timing can be changed in a config file (.env), so that it can be fine tuned in each environment.

Testing

  • If the new parameters are NOT added to your local .env-file then there should be no change to the system's behavior.
  • If the new parameters are added, then the caching should be scheduled accordingly.
    • FOR EXAMPLE:
      • if the parameters are:
      • germplasm_start_delay=5s study_start_delay=10s trial_start_delay=15s trait_start_delay=20s observation_start_delay=25s observation_unit_start_delay=30s
        • THEN you should see line in you bi-api log that look something like:

2025-02-17 15:16:29.987-0500 [scheduled-executor-thread-1] DEBUG o.b.brapi.v2.dao.BrAPIGermplasmDAO - populating germplasm cache

2025-02-17 15:16:35.559-0500 [scheduled-executor-thread-3] DEBUG o.b.brapi.v2.dao.BrAPIStudyDAO - populating study cache

2025-02-17 15:16:40.548-0500 [scheduled-executor-thread-7] DEBUG o.b.b.v2.dao.impl.BrAPITrialDAOImpl - populating experiment cache

2025-02-17 15:16:50.548-0500 [scheduled-executor-thread-6] DEBUG o.b.brapi.v2.dao.BrAPIObservationDAO - populating observation cache

2025-02-17 15:16:55.551-0500 [scheduled-executor-thread-8] DEBUG o.b.b.v2.dao.BrAPIObservationUnitDAO - populating observation unit cache

Note: there is at least 5-seconds between each line.

Checklist:

  • I have performed a self-review of my own code
  • [ x I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <please include a link to TAF run>

@davedrp davedrp requested review from a team, nickpalladino and HMS17 and removed request for a team February 17, 2025 20:28
Copy link
Member

@nickpalladino nickpalladino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this approach as a first step. If we decide we want to simplify the config file in the future after doing some experimenting with the parameters we can always do that. Just had a comment about matching case of the new envs.

@davedrp davedrp merged commit 03326c6 into develop Feb 26, 2025
1 check passed
@davedrp davedrp deleted the feature/BI-2450 branch February 26, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants