feat: Implement round-robin color assignment for workers instead of random unique assignment.#107
Open
codxbrexx wants to merge 1 commit intometacall:masterfrom
Open
Conversation
c492ecf to
a094f5c
Compare
9a8e39f to
a094f5c
Compare
Contributor
Author
|
Need Help... |
…andom unique assignment.
b83ac0f to
a55a288
Compare
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the
do...whilerandom-search loop insrc/utils/logger.tswith a simple round-robin index. Removes the now-unnecessaryAssignedColorCodesTypeinterface andassignedColorCodesmap.Related issue
Fixes #103
Part of tracking epic #99
Type of change
How to test
fix/logger-color-pool-infinite-loopnpm cinpm startChecklist
Notes for reviewers
One file changed —
src/utils/logger.ts. Thedo...whileloop that spun forever when all 16 ANSI color slots were taken is replaced withANSICode[colorIndex % ANSICode.length]. Colors now cycle once all 16 are in use instead of locking the event loop. TheassignedColorCodestracking map and its interface are removed since they're no longer needed.Release notes
Fixed a server hang triggered when logging output from 17 or more simultaneous deployments.
Notes for reviewers
The fix addresses a
TODOregarding an endless loop hazard with a minimal algorithm change, verified by spawning 20 concurrent deployments without locking the event loop.Release notes
Fixed a severe
faasserver hang triggered when logging output from 17 or more simultaneous deployments.Test
Note for reviewers: The CI integration tests fixed on this PR will be fixed after #122 (CI fix — healthcheck, busboy race, protocol patch) is merged first. The logger change itself is isolated to
src/utils/logger.tsand has no dependency on those fixes at the code level.