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

Fix the structure of cache to avoid unexpected errors #1022

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fusawa-yugo
Copy link

@fusawa-yugo fusawa-yugo commented Jan 29, 2025

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • [x ] I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

What does this implement/fix? Explain your changes.

The previous implementation used a cache with a module-global scope.
In this case, cache contamination occurs when you run multiple Optuna Dashboard servers with different storages within a single process.

To address this, I made the cache an attribute of the Bottle object.

app = Bottle()
app._inmemory_cache = InMemoryCache()

@fusawa-yugo fusawa-yugo force-pushed the fusawa-yugo/test-cache branch from f086a20 to 7a92876 Compare January 29, 2025 05:16
@porink0424 porink0424 changed the title FIx the structure of cache to avoid unexpcted errors Fix the structure of cache to avoid unexpected errors Jan 29, 2025
@porink0424 porink0424 self-assigned this Jan 29, 2025
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 this pull request may close these issues.

3 participants