Circuit Breaker
A checkout page calls a payment service. The payment service is down. Each call waits a long time and then fails. Soon the checkout page is slow too, and then other pages slow down. A circuit breaker helps prevent this kind of cascading failure Source 1সোর্স 1.
7 min read7 মিনিটে পড়া যায় · 10 sections10টি সেকশন · 2 sources2টি সোর্স · updated Nov 2026আপডেট: Nov 2026
A circuit breaker trips and healsসার্কিট ব্রেকার ট্রিপ করে আর সেরে ওঠে
Break the service and watch the breaker go Closed, Open, Half-Open, and Closed again.সার্ভিস ভাঙুন আর দেখুন ব্রেকার Closed, Open, Half-Open হয়ে আবার Closed হচ্ছে।
You’ll learnআপনি শিখবেন
- The three breaker statesব্রেকারের তিনটি স্টেট✓
- What trips the breakerকী ব্রেকারকে ট্রিপ করায়
- Why Open protects the serviceOpen কেন সার্ভিসকে বাঁচায়
- How trial calls close it againট্রায়াল কল কীভাবে আবার Closed করে
In plain words
The Circuit Breaker pattern blocks access to a remote service for a while, after the failures reach a threshold. This avoids repeated retries of an operation that is likely to fail. It also gives the failing service room to recover Source 1সোর্স 1. The AWS guidance says the pattern also detects when the called service works again Source 2সোর্স 2.
The AWS guidance says breaker objects work like electrical circuit breakers Source 2সোর্স 2. The breaker object sits between the caller and the called service, and it trips if the called service is unavailable Source 2সোর্স 2.
Some faults are transient, such as a slow network. They typically fix themselves in a short time, and a retry can handle them. Other faults last longer, up to a full outage. Then the application should not keep retrying Source 1সোর্স 1.
A time-out alone does not solve this. Waiting requests can hold memory, threads, and database connections. This can exhaust resources and break unrelated parts of the system Source 1সোর্স 1. Repeated retries can also add network load and use up database threads Source 2সোর্স 2.
সহজ English
The Circuit Breaker pattern blocks access to a remote service for a while, after the failures reach a threshold. This avoids repeated retries of an operation that is likely to fail. It also gives the failing service room to recover Source 1সোর্স 1. The AWS guidance says the pattern also detects when the called service works again Source 2সোর্স 2.
The AWS guidance says breaker objects work like electrical circuit breakers Source 2সোর্স 2. The breaker object sits between the caller and the called service. It trips if the called service is unavailable Source 2সোর্স 2.
Some faults are transient, such as a slow network. They typically fix themselves in a short time, and a retry can handle them. Other faults last longer, up to a full outage. Then the application should not keep retrying Source 1সোর্স 1.
A time-out alone does not solve this. Waiting requests can hold memory, threads, and database connections. This can exhaust resources and break unrelated parts of the system Source 1সোর্স 1. Repeated retries can also add network load and use up database threads Source 2সোর্স 2.
বাংলা ব্যাখ্যা
Circuit Breaker প্যাটার্ন ফেইলিউর থ্রেশহোল্ডে (threshold) পৌঁছানোর পর কিছু সময়ের জন্য একটি রিমোট সার্ভিসে প্রবেশ আটকে দেয়। এতে ব্যর্থ হওয়ার সম্ভাবনাযুক্ত অপারেশন বারবার রিট্রাই (retry) করা এড়ানো যায়। এটি ব্যর্থ সার্ভিসকে সেরে ওঠার সুযোগও দেয় Source 1সোর্স 1। AWS-এর নির্দেশিকা বলে, প্যাটার্নটি ডাকা সার্ভিস আবার কাজ করছে কিনা তাও শনাক্ত করে Source 2সোর্স 2।
AWS-এর নির্দেশিকা বলে, ব্রেকার অবজেক্ট বৈদ্যুতিক সার্কিট ব্রেকারের মতো কাজ করে Source 2সোর্স 2। ব্রেকার অবজেক্ট কলার (caller) ও ডাকা সার্ভিসের মাঝখানে থাকে। ডাকা সার্ভিস অনুপলব্ধ (unavailable) হলে সে ট্রিপ করে Source 2সোর্স 2।
কিছু ফল্ট (fault) ট্রানজিয়েন্ট (transient), যেমন ধীর নেটওয়ার্ক। সেগুলো সাধারণত অল্প সময়ে নিজে ঠিক হয়ে যায়, এবং একটি রিট্রাই সেগুলো সামলাতে পারে। অন্য ফল্ট বেশি সময় থাকে, এমনকি পুরো আউটেজ (outage) পর্যন্ত। তখন অ্যাপ্লিকেশনের বারবার রিট্রাই করা উচিত নয় Source 1সোর্স 1।
শুধু একটি টাইমআউট এই সমস্যা মেটায় না। অপেক্ষারত রিকুয়েস্ট মেমরি, থ্রেড ও ডেটাবেস কানেকশন ধরে রাখতে পারে। এতে রিসোর্স ফুরিয়ে যেতে পারে এবং সিস্টেমের সম্পর্কহীন অংশ ভেঙে যেতে পারে Source 1সোর্স 1। বারবার রিট্রাই নেটওয়ার্কের লোড বাড়াতে এবং ডেটাবেস থ্রেড ফুরিয়ে দিতে পারে Source 2সোর্স 2।
When you need it
Azure lists these cases, among others Source 1সোর্স 1:
- You want to stop cascading failures by not sending calls that are likely to fail.
- You want to protect your service-level objectives from slow dependencies.
- You want to manage intermittent connection problems.
- You want to route traffic by real-time failure signals, to improve multi-region resilience.
AWS adds these signs: a call is most likely to fail, or a synchronous call goes to a callee that is unavailable or slow Source 2সোর্স 2.
সহজ English
Azure lists these cases, among others Source 1সোর্স 1:
- You want to stop cascading failures by not sending calls that are likely to fail.
- You want to protect your service-level objectives from slow dependencies.
- You want to manage intermittent connection problems.
- You want to route traffic by real-time failure signals, to improve multi-region resilience.
AWS adds these signs. A call is most likely to fail. Or a synchronous call goes to a callee that is unavailable or slow Source 2সোর্স 2.
বাংলা ব্যাখ্যা
Azure অন্যান্য ক্ষেত্রের সঙ্গে এই ক্ষেত্রগুলোও তালিকাভুক্ত করে Source 1সোর্স 1:
- ব্যর্থ হওয়ার সম্ভাবনাযুক্ত কল না পাঠিয়ে আপনি ক্যাসকেডিং ফেইলিউর (cascading failure) থামাতে চান।
- ধীর ডিপেন্ডেন্সি (dependency) থেকে আপনি আপনার সার্ভিস-লেভেল অবজেক্টিভ (service-level objective) রক্ষা করতে চান।
- আপনি মাঝেমধ্যে হওয়া কানেকশন সমস্যা সামলাতে চান।
- আপনি রিয়েল-টাইম ব্যর্থতার সংকেত দেখে ট্র্যাফিক রুট করতে চান, যাতে মাল্টি-রিজিয়ন (multi-region) সহনশীলতা বাড়ে।
AWS এই লক্ষণগুলো যোগ করে। একটি কলের ব্যর্থ হওয়ার সম্ভাবনাই বেশি। অথবা একটি সিনক্রোনাস (synchronous) কল এমন সার্ভিসের কাছে যায়, যা অনুপলব্ধ বা ধীর Source 2সোর্স 2।
How it works
The breaker works as a proxy. It watches the recent failures and decides if a call goes through or fails at once. You can build it as a state machine with three states Source 1সোর্স 1.
failures pass the threshold
within the time period
CLOSED ------------------------------> OPEN
^ |
| | time-out timer ends
| enough trial calls succeed v
+------------- HALF-OPEN <------------+
|
| a trial call fails
+--------> OPEN (timer restarts)This drawing is the tutorial's own picture of the Azure description.
| State | What happens |
|---|---|
| Closed | Calls go to the operation. The proxy counts recent failures. If the count passes the threshold in the time period, the proxy goes to Open and starts a time-out timer Source 1সোর্স 1. |
| Open | Each call fails at once with an exception Source 1সোর্স 1. |
| Half-Open | The timer ended. A limited number of calls pass through. If they succeed, the breaker assumes the fault is fixed and goes to Closed. If any call fails, it goes back to Open and restarts the timer Source 1সোর্স 1. |
The Half-Open state helps to avoid a flood of requests to a service that is still recovering Source 1সোর্স 1. The AWS page does not name this state. It describes the same idea in simpler words: after the circuit opens, the breaker tries calls from time to time and closes the circuit when they succeed Source 2সোর্স 2.
সহজ English
The breaker works as a proxy. It watches the recent failures and decides if a call goes through or fails at once. You can build it as a state machine with three states Source 1সোর্স 1.
This is the tutorial's own picture of the Azure description:
- Closed to Open: the failures pass the threshold within the time period.
- Open to Half-Open: the time-out timer ends.
- Half-Open to Closed: enough trial calls succeed.
- Half-Open to Open: a trial call fails. The timer restarts.
The three states:
- Closed: Calls go to the operation. The proxy counts recent failures. If the count passes the threshold in the time period, the proxy goes to Open and starts a time-out timer Source 1সোর্স 1.
- Open: Each call fails at once with an exception Source 1সোর্স 1.
- Half-Open: The timer ended. A limited number of calls pass through. If they succeed, the breaker assumes the fault is fixed and goes to Closed. If any call fails, it goes back to Open and restarts the timer Source 1সোর্স 1.
The Half-Open state helps to avoid a flood of requests to a service that is still recovering Source 1সোর্স 1. The AWS page does not name this state. It describes the same idea in simpler words. After the circuit opens, the breaker tries calls from time to time. It closes the circuit when they succeed Source 2সোর্স 2.
বাংলা ব্যাখ্যা
ব্রেকার একটি প্রক্সি হিসেবে কাজ করে। সে সাম্প্রতিক ফেইলিউর দেখে এবং ঠিক করে একটি কল পার হবে নাকি সঙ্গে সঙ্গে ব্যর্থ হবে। আপনি এটিকে তিনটি স্টেট-সহ একটি স্টেট মেশিন (state machine) হিসেবে বানাতে পারেন Source 1সোর্স 1।
এটি Azure-এর বর্ণনার টিউটোরিয়ালের নিজস্ব ছবি:
- Closed থেকে Open: সময়কালের (time period) মধ্যে ফেইলিউর থ্রেশহোল্ড পার হয়।
- Open থেকে Half-Open: টাইমআউট টাইমার শেষ হয়।
- Half-Open থেকে Closed: যথেষ্ট ট্রায়াল কল সফল হয়।
- Half-Open থেকে Open: একটি ট্রায়াল কল ব্যর্থ হয়। টাইমার আবার শুরু হয়।
তিনটি স্টেট:
- Closed: কল অপারেশনে যায়। প্রক্সি সাম্প্রতিক ফেইলিউর গোনে। সংখ্যা সময়কালের মধ্যে থ্রেশহোল্ড পার হলে প্রক্সি Open-এ যায় এবং একটি টাইমআউট টাইমার শুরু করে Source 1সোর্স 1।
- Open: প্রতিটি কল একটি এক্সসেপশন-সহ (exception) সঙ্গে সঙ্গে ব্যর্থ হয় Source 1সোর্স 1।
- Half-Open: টাইমার শেষ হয়েছে। সীমিত সংখ্যক কল পার হয়। সেগুলো সফল হলে ব্রেকার ধরে নেয় ফল্ট ঠিক হয়েছে এবং Closed-এ যায়। কোনো কল ব্যর্থ হলে সে আবার Open-এ ফেরে এবং টাইমার আবার শুরু করে Source 1সোর্স 1।
Half-Open স্টেট এমন সার্ভিসে রিকুয়েস্টের বন্যা এড়াতে সাহায্য করে, যা এখনো সেরে উঠছে Source 1সোর্স 1। AWS-এর পেজ এই স্টেটের নাম দেয় না। সে একই ধারণা সহজ কথায় বর্ণনা করে। সার্কিট খোলার পর ব্রেকার মাঝেমধ্যে কল চেষ্টা করে। সেগুলো সফল হলে সে সার্কিট বন্ধ করে Source 2সোর্স 2।
Thresholds and time-outs
Azure describes these settings Source 1সোর্স 1:
- Failure threshold. The failure counter of the Closed state is time based, and it resets at intervals. This design helps prevent a few random failures from opening the breaker.
- Success count. In Half-Open, the breaker returns to Closed after a set number of successful calls in a row. One failure opens it at once.
- Time-out. It can grow. The first Open period can be a few seconds, and a later one a few minutes.
The source gives no default numbers. It says to match the settings to the likely recovery of the protected operation Source 1সোর্স 1. If the Open period is too long, the breaker can raise errors after the fault is fixed. If the breaker moves to Half-Open too fast, it can fluctuate and slow the responses Source 1সোর্স 1.
More details:
- In Open, the breaker can return a default value that makes sense for the application, not an exception Source 1সোর্স 1.
- An administrator should be able to open or close a circuit by hand Source 1সোর্স 1 Source 2সোর্স 2.
- With many threads, the first failed call sets the AWS expiration time. Later calls should not keep moving it Source 2সোর্স 2.
সহজ English
Azure describes these settings Source 1সোর্স 1:
- Failure threshold. The failure counter of the Closed state is time based, and it resets at intervals. This design helps prevent a few random failures from opening the breaker.
- Success count. In Half-Open, the breaker returns to Closed after a set number of successful calls in a row. One failure opens it at once.
- Time-out. It can grow. The first Open period can be a few seconds, and a later one a few minutes.
The source gives no default numbers. It says to match the settings to the likely recovery of the protected operation Source 1সোর্স 1. If the Open period is too long, the breaker can raise errors after the fault is fixed. If the breaker moves to Half-Open too fast, it can fluctuate and slow the responses Source 1সোর্স 1.
More details:
- In Open, the breaker can return a default value that makes sense for the application, not an exception Source 1সোর্স 1.
- An administrator should be able to open or close a circuit by hand Source 1সোর্স 1 Source 2সোর্স 2.
- With many threads, the first failed call sets the AWS expiration time. Later calls should not keep moving it Source 2সোর্স 2.
বাংলা ব্যাখ্যা
Azure এই সেটিংগুলো বর্ণনা করে Source 1সোর্স 1:
- ফেইলিউর থ্রেশহোল্ড (Failure threshold)। Closed স্টেটের ফেইলিউর কাউন্টার সময়-ভিত্তিক, এবং এটি বিরতি দিয়ে রিসেট হয়। এই ডিজাইন কিছু এলোমেলো ফেইলিউরকে ব্রেকার খুলে দেওয়া থেকে আটকাতে সাহায্য করে।
- সাকসেস কাউন্ট (Success count)। Half-Open-এ ব্রেকার পরপর নির্দিষ্ট সংখ্যক সফল কলের পর Closed-এ ফেরে। একটি ফেইলিউর সঙ্গে সঙ্গে তাকে খুলে দেয়।
- টাইমআউট (Time-out)। এটি বাড়তে পারে। প্রথম Open সময় কয়েক সেকেন্ড হতে পারে, আর পরের সময় কয়েক মিনিট।
সোর্স কোনো ডিফল্ট সংখ্যা দেয় না। সে বলে, সেটিংগুলো সুরক্ষিত অপারেশনের সম্ভাব্য রিকভারির সঙ্গে মেলাতে হবে Source 1সোর্স 1। Open সময় বেশি লম্বা হলে ফল্ট ঠিক হওয়ার পরও ব্রেকার এরর তুলতে পারে। ব্রেকার খুব দ্রুত Half-Open-এ গেলে সে ওঠানামা করতে পারে এবং রেসপন্স ধীর করতে পারে Source 1সোর্স 1।
আরও কিছু বিষয়:
- Open-এ ব্রেকার এক্সসেপশন না দিয়ে অ্যাপ্লিকেশনের জন্য অর্থবহ একটি ডিফল্ট মান ফেরত দিতে পারে Source 1সোর্স 1।
- অ্যাডমিনিস্ট্রেটরের ম্যানুয়ালি সার্কিট খুলতে বা বন্ধ করতে পারা উচিত Source 1সোর্স 1 Source 2সোর্স 2।
- অনেক থ্রেড থাকলে প্রথম ব্যর্থ কল AWS-এর এক্সপায়ারেশন টাইম (expiration time) ঠিক করে। পরের কলগুলোর সেটি বারবার সরানো উচিত নয় Source 2সোর্স 2।
Circuit breaker and retry
The two patterns have different goals. Retry expects the operation to succeed in the end. The circuit breaker stops an operation that is likely to fail Source 1সোর্স 1. A retry with backoff handles transient errors Source 2সোর্স 2.
You can combine them: retry through a breaker. Then the retry logic should stop when the breaker shows that the fault is not transient Source 1সোর্স 1. The AWS sample retries with exponential backoff a set number of times. If all fail, it records an expiry time, and later calls fail at once until that time passes Source 2সোর্স 2.
সহজ English
The two patterns have different goals. Retry expects the operation to succeed in the end. The circuit breaker stops an operation that is likely to fail Source 1সোর্স 1. A retry with backoff handles transient errors Source 2সোর্স 2.
You can combine them: retry through a breaker. Then the retry logic should stop when the breaker shows that the fault is not transient Source 1সোর্স 1. The AWS sample retries with exponential backoff a set number of times. If all fail, it records an expiry time. Later calls fail at once until that time passes Source 2সোর্স 2.
বাংলা ব্যাখ্যা
দুটি প্যাটার্নের লক্ষ্য আলাদা। রিট্রাই (retry) আশা করে অপারেশন শেষ পর্যন্ত সফল হবে। Circuit breaker ব্যর্থ হওয়ার সম্ভাবনাযুক্ত অপারেশন থামায় Source 1সোর্স 1। ব্যাকঅফ-সহ (backoff) রিট্রাই ট্রানজিয়েন্ট এরর সামলায় Source 2সোর্স 2।
আপনি দুটি মেলাতে পারেন: ব্রেকারের মধ্য দিয়ে রিট্রাই। তখন ব্রেকার যখন দেখায় ফল্ট ট্রানজিয়েন্ট নয়, রিট্রাইয়ের লজিক থেমে যাওয়া উচিত Source 1সোর্স 1। AWS-এর স্যাম্পল নির্দিষ্ট সংখ্যকবার এক্সপোনেনশিয়াল ব্যাকঅফ-সহ (exponential backoff) রিট্রাই করে। সব ব্যর্থ হলে সে মেয়াদ শেষের একটি সময় (expiry time) লিখে রাখে। ওই সময় পার না হওয়া পর্যন্ত পরের কল সঙ্গে সঙ্গে ব্যর্থ হয় Source 2সোর্স 2।
When not to use it
Azure says the pattern might not suit these cases Source 1সোর্স 1:
- Local private resources, such as in-memory data. The breaker adds overhead there.
- A replacement for exception handling in business logic.
- Well-known retry methods are enough and the dependencies handle retries. The breaker may add needless complexity.
- A wait for the reset would cause unacceptable delay.
- Message-driven or event-driven systems, where failed messages often go to a dead letter queue.
- The platform already handles recovery, for example health checks in a load balancer or a service mesh.
সহজ English
Azure says the pattern might not suit these cases Source 1সোর্স 1:
- Local private resources, such as in-memory data. The breaker adds overhead there.
- A replacement for exception handling in business logic.
- Well-known retry methods are enough and the dependencies handle retries. The breaker may add needless complexity.
- A wait for the reset would cause unacceptable delay.
- Message-driven or event-driven systems, where failed messages often go to a dead letter queue.
- The platform already handles recovery, for example health checks in a load balancer or a service mesh.
বাংলা ব্যাখ্যা
Azure বলে, প্যাটার্নটি এই ক্ষেত্রগুলোর জন্য মানাতে নাও পারে Source 1সোর্স 1:
- স্থানীয় ব্যক্তিগত রিসোর্স, যেমন ইন-মেমরি (in-memory) ডেটা। সেখানে ব্রেকার বাড়তি ওভারহেড (overhead) যোগ করে।
- বিজনেস লজিকে এক্সসেপশন হ্যান্ডলিংয়ের বিকল্প হিসেবে।
- সুপরিচিত রিট্রাই পদ্ধতিই যথেষ্ট এবং ডিপেন্ডেন্সিগুলো নিজেরাই রিট্রাই সামলায়। ব্রেকার অপ্রয়োজনীয় জটিলতা যোগ করতে পারে।
- রিসেটের জন্য অপেক্ষা অগ্রহণযোগ্য দেরি ঘটাবে।
- মেসেজ-ড্রিভেন (message-driven) বা ইভেন্ট-ড্রিভেন (event-driven) সিস্টেম, যেখানে ব্যর্থ মেসেজ প্রায়ই ডেড লেটার কিউতে (dead letter queue) যায়।
- প্ল্যাটফর্ম আগে থেকেই রিকভারি সামলায়, যেমন লোড ব্যালেন্সার বা সার্ভিস মেশের (service mesh) হেলথ চেক।
A real-life example
This example is the tutorial's own. An order service calls a payment service through a breaker. The breaker is Closed. Then the payment service starts to time out, and the failure threshold is reached. The breaker opens.
Now the order service gets an error at once and shows "Payments are busy. Try again soon." When the timer ends, a few trial calls pass. They succeed, so the breaker closes.
সহজ English
This example is the tutorial's own. An order service calls a payment service through a breaker. The breaker is Closed. Then the payment service starts to time out. The failure threshold is reached. The breaker opens.
Now the order service gets an error at once. It shows "Payments are busy. Try again soon." When the timer ends, a few trial calls pass. They succeed, so the breaker closes.
বাংলা ব্যাখ্যা
এই উদাহরণ টিউটোরিয়ালের নিজস্ব। একটি অর্ডার সার্ভিস একটি ব্রেকারের মধ্য দিয়ে একটি পেমেন্ট সার্ভিসকে ডাকে। ব্রেকার Closed। তারপর পেমেন্ট সার্ভিস টাইমআউট হতে শুরু করে। ফেইলিউর থ্রেশহোল্ডে পৌঁছে যায়। ব্রেকার খুলে যায়।
এখন অর্ডার সার্ভিস সঙ্গে সঙ্গে একটি এরর পায়। সে "Payments are busy. Try again soon." দেখায়। টাইমার শেষ হলে কয়েকটি ট্রায়াল কল পার হয়। সেগুলো সফল হয়, তাই ব্রেকার বন্ধ হয়।
Common mistakes
- Retrying for a long fault with no breaker. Blocked requests can use up threads and connections Source 1সোর্স 1.
- No plan for the exception. The application can degrade a feature, call an alternative, or ask the user to try later Source 1সোর্স 1.
- A time-out that is too long. A thread can stay blocked for a long time before the breaker sees the failure Source 1সোর্স 1.
- One breaker for unrelated providers. A problem in one shard can block calls to a healthy shard Source 1সোর্স 1.
সহজ English
- Retrying for a long fault with no breaker. Blocked requests can use up threads and connections Source 1সোর্স 1.
- No plan for the exception. The application can degrade a feature, call an alternative, or ask the user to try later Source 1সোর্স 1.
- A time-out that is too long. A thread can stay blocked for a long time before the breaker sees the failure Source 1সোর্স 1.
- One breaker for unrelated providers. A problem in one shard can block calls to a healthy shard Source 1সোর্স 1.
বাংলা ব্যাখ্যা
- ব্রেকার ছাড়া দীর্ঘ ফল্টের জন্য রিট্রাই করা। আটকে থাকা রিকুয়েস্ট থ্রেড ও কানেকশন ফুরিয়ে দিতে পারে Source 1সোর্স 1।
- এক্সসেপশনের জন্য কোনো পরিকল্পনা না থাকা। অ্যাপ্লিকেশন একটি ফিচার সীমিত করতে পারে, একটি বিকল্প ডাকতে পারে, অথবা ইউজারকে পরে চেষ্টা করতে বলতে পারে Source 1সোর্স 1।
- খুব লম্বা টাইমআউট। ব্রেকার ফেইলিউর দেখার আগে একটি থ্রেড দীর্ঘ সময় আটকে থাকতে পারে Source 1সোর্স 1।
- সম্পর্কহীন প্রোভাইডারের জন্য একটি ব্রেকার। একটি শার্ডের সমস্যা একটি সুস্থ শার্ডে কল আটকে দিতে পারে Source 1সোর্স 1।
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice, not a claim of the sources.
- Trip it. Make the dependency fail until the threshold. Check that the breaker opens and that the next call fails at once.
- Check the user message. In Open, check that the user sees a clear message or a sensible default, not a raw error.
- Watch the Half-Open step. Wait for the time-out. Check that only a few trial calls pass, then that success closes the breaker and a failure opens it again.
- Try random failures. Send a few failures spread over time. Check that the breaker stays Closed.
- Check the logs and events. Check that each state change and each rejected call is visible to the team.
সহজ English
These test ideas are the tutorial's own advice, not a claim of the sources.
- Trip it. Make the dependency fail until the threshold. Check that the breaker opens and that the next call fails at once.
- Check the user message. In Open, check that the user sees a clear message or a sensible default, not a raw error.
- Watch the Half-Open step. Wait for the time-out. Check that only a few trial calls pass. Then check that success closes the breaker and a failure opens it again.
- Try random failures. Send a few failures spread over time. Check that the breaker stays Closed.
- Check the logs and events. Check that each state change and each rejected call is visible to the team.
বাংলা ব্যাখ্যা
এই টেস্টের ধারণাগুলো টিউটোরিয়ালের নিজস্ব পরামর্শ, সোর্সের দাবি নয়।
- ট্রিপ করান। থ্রেশহোল্ড পর্যন্ত ডিপেন্ডেন্সিকে ব্যর্থ করান। ব্রেকার খোলে কিনা এবং পরের কল সঙ্গে সঙ্গে ব্যর্থ হয় কিনা যাচাই করুন।
- ইউজার মেসেজ যাচাই করুন। Open-এ ইউজার একটি স্পষ্ট মেসেজ বা যুক্তিসঙ্গত ডিফল্ট দেখে কিনা দেখুন, কাঁচা এরর নয়।
- Half-Open ধাপ দেখুন। টাইমআউট পর্যন্ত অপেক্ষা করুন। শুধু কয়েকটি ট্রায়াল কল পার হয় কিনা দেখুন। তারপর দেখুন সাফল্য ব্রেকার বন্ধ করে এবং ব্যর্থতা আবার খুলে দেয় কিনা।
- এলোমেলো ফেইলিউর চেষ্টা করুন। সময়ের উপর ছড়ানো কয়েকটি ফেইলিউর পাঠান। ব্রেকার Closed থাকে কিনা দেখুন।
- লগ ও ইভেন্ট যাচাই করুন। প্রতিটি স্টেট পরিবর্তন ও প্রতিটি প্রত্যাখ্যাত কল টিমের কাছে দৃশ্যমান কিনা দেখুন।
Key words
| Word | Meaning |
|---|---|
| Circuit breaker | A proxy between a caller and a called service that stops calls likely to fail Source 1সোর্স 1 Source 2সোর্স 2 |
| Closed | The state in which calls go through and the proxy counts recent failures Source 1সোর্স 1 |
| Open | The state in which each call fails at once Source 1সোর্স 1 |
| Half-Open | The state in which a limited number of trial calls pass Source 1সোর্স 1 |
| Threshold | The number of failures in a time period that opens the breaker Source 1সোর্স 1 |
| Time-out timer | The wait in the Open state before the breaker tries again Source 1সোর্স 1 |
| Expiration timeout | In the AWS guidance, how long the circuit stays tripped before calls are routed again Source 2সোর্স 2 |
| Cascading failure | A failure in one part that spreads to other parts Source 1সোর্স 1 |
| Transient fault | A short fault that typically corrects itself Source 1সোর্স 1 |
| Retry | Trying a failed operation again, in the hope that it succeeds Source 1সোর্স 1 |