The order service has a timeout period of three seconds as shown below:
After fault injection is configured for the stock service, it is found that user requests to the website will be in the waiting status due to the fault. To optimize the browsing experience, a timeout period needs to be configured.
Configure a timeout period of three seconds for the order service by applying the following
VirtualService and no timeout period for the cart service.
After the configuration, add an item to the cart, and the cart service will experience an access latency of seven seconds due to the injected fault, without a timeout. Then, click CHECKOUT to start the checkout process and call the order service, and, in addition to the access latency of seven seconds, the order service will experience a timeout period of three seconds, which means a timeout will occur if no operation is performed within three seconds after the order service is called.
The timeout occurring when the cart service calls the order service is as shown below:
After completing the timeout configuration and the fault injection test on the service, delete the
VirtualService resource associated with the stock service to disassociate the configured fault injection policy from the stock service.
VirtualService associated with the stock service as shown below: