Skip to content

Use logger.warning instead of optuna_warn for lock-acquisition delay notifications - #6400

Merged
y0z merged 3 commits into
optuna:masterfrom
sawa3030:add-warning-for-journal-lock-2
Jan 16, 2026
Merged

y0z merged 3 commits into
optuna:masterfrom
sawa3030:add-warning-for-journal-lock-2

Conversation

@sawa3030

Copy link
Copy Markdown
Contributor

Motivation

Follow-up to #6361. This message is not something users can fix by changing their code, but it’s still useful to note as an event. Per Python’s logging guide, this should be logged via logger.warning() rather than raised with warnings.warn().

Description of the changes

  • Replace warnings.warn() with logger.warning() for the lock-acquisition delay notification.

@not522

not522 commented Dec 26, 2025

Copy link
Copy Markdown
Member

@c-bata Could you review this PR?

@github-actions

github-actions Bot commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has not seen any recent activity.

@github-actions github-actions Bot added the stale Exempt from stale bot labeling. label Jan 4, 2026
@c-bata c-bata added code-fix Change that does not change the behavior, such as code refactoring. and removed stale Exempt from stale bot labeling. labels Jan 5, 2026

@c-bata c-bata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sawa3030 Changes look good to me. I was wondering if it would also make sense to switch warnings.warn() to _logger.warning() in the following two places as well. What do you think?

optuna_warn(
"The existing lock file has not been released "
"for an extended period. Forcibly releasing the lock file."
)

optuna_warn(
"The existing lock file has not been released "
"for an extended period. Forcibly releasing the lock file."
)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has not seen any recent activity.

@github-actions github-actions Bot added the stale Exempt from stale bot labeling. label Jan 12, 2026
@sawa3030

Copy link
Copy Markdown
Contributor Author

@c-bata Thanks for the suggestion. I’ve replaced warnings.warn() with _logger.warning() in those two places as well.

@c-bata c-bata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@c-bata c-bata removed the stale Exempt from stale bot labeling. label Jan 14, 2026
@c-bata c-bata removed their assignment Jan 14, 2026

@y0z y0z left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@y0z
y0z merged commit adbe6f5 into optuna:master Jan 16, 2026
@y0z y0z unassigned not522 Jan 16, 2026
@y0z y0z added this to the v4.7.0 milestone Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-fix Change that does not change the behavior, such as code refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants