• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bolshakov / stoplight / 15257581422
100%

Build:
DEFAULT BRANCH: master
Ran 26 May 2025 03:33PM UTC
Jobs 3
Files 37
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 May 2025 03:32PM UTC coverage: 100.0%. Remained the same
15257581422

push

github

web-flow
Redesigned Stoplight Color Management (#313)

This PR introduces a significant redesign of Stoplight's core data structures and color management to address several limitations in the current implementation and improve its ability to function reliably in distributed environments.

## Motivation

The current Stoplight implementation suffers from several limitations that impact its effectiveness as a circuit breaker:

1. **Intermittent Failure Blindness**: When a service experiences a high failure rate but occasionally succeeds, the circuit breaker may never trigger. For example, with a threshold of 10 errors, a service failing 9 out of 10 requests (90% failure rate) would never open the circuit because each success resets the error count to zero.

2. **State Transition Coordination Problems**: The yellow (half-open) state implementation is particularly problematic in the current design. The system determines when to enter the half-open state based on the age of the oldest failure in the set. However, due to the time-windowed approach:
    * Failures naturally age out of the window regardless of whether recovery has been tested
    * This can cause the Stoplight to transition directly from RED to GREEN without properly going through the YELLOW testing phase
    * Different Stoplight instances may see different states based on their specific window boundaries

## Key Changes

An important part of this PR is the introduction of the `Stoplight::Metadata` class, which provides a comprehensive view of a Stoplight's health and state. This data-rich object consolidates all the information needed for making intelligent circuit breaker decisions in one place. The Metadata object includes the following attributes:

* **`successes`**: Count of successful operations within the configured time window
* **`failures`**: Count of failed operations within the configured time window
* **`recovery_probe_successes`**: Count of successful recovery tests during the YELLOW sta... (continued)

395 of 395 new or added lines in 18 files covered. (100.0%)

816 of 816 relevant lines covered (100.0%)

907.52 hits per line

Jobs
ID Job ID Ran Files Coverage
1 ruby-3.4 - 15257581422.1 26 May 2025 03:33PM UTC 37
100.0
GitHub Action Run
2 ruby-3.2 - 15257581422.2 26 May 2025 03:33PM UTC 37
100.0
GitHub Action Run
3 ruby-3.3 - 15257581422.3 26 May 2025 03:33PM UTC 37
100.0
GitHub Action Run
Source Files on build 15257581422
  • Tree
  • List 37
  • Changed 14
  • Source Changed 0
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e5b19568 on github
  • Prev Build on master (#15225712027)
  • Next Build on master (#15257586770)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc