X Tutup
Skip to content

Rephrase Logger documentation to be more explicit about thread-safety#110614

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
mihe:logger-thread-safety
Sep 22, 2025
Merged

Rephrase Logger documentation to be more explicit about thread-safety#110614
Repiteo merged 1 commit intogodotengine:masterfrom
mihe:logger-thread-safety

Conversation

@mihe
Copy link
Contributor

@mihe mihe commented Sep 17, 2025

The current phrasing (as written by me) of the thread-safety warning for Logger._log_message and Logger._log_error is perhaps a bit too timid and arguably makes thread-safety sound optional, which it very much is not. Threads spun up by the engine internally can emit errors, which will invoke these callbacks from said threads, meaning any and all implementations of Logger are subject to race conditions unless accommodated for.

I was/am a little bit tempted to throw in a scary "or you can crash the entire process" just to really drive home the point, but maybe that's excessive?

@mihe mihe added this to the 4.6 milestone Sep 17, 2025
@mihe mihe requested a review from a team as a code owner September 17, 2025 12:49
@mihe mihe added enhancement documentation cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Sep 17, 2025
Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Either you do need thread safety mechanisms, or you don't. There's no in between.

@Repiteo Repiteo merged commit 2288081 into godotengine:master Sep 22, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 22, 2025

Thanks!

@mihe mihe deleted the logger-thread-safety branch September 22, 2025 19:03
@akien-mga akien-mga removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup