zowe / zowe/api-layer

Detection of failed services during routing

Open
#4,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Priority: High size/M
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

There is a mechanism how to handle network issue during resending request to a service:

https://github.com/zowe/api-layer/blob/606d2b3bcb9ab2b6d324c8cef52102f76055c7db/gateway-service/src/main/java/org/zowe/apiml/gateway/config/NettyRoutingFilterApiml.java#L85-L94

The aim is detect that service is down. In this case GW returns 503 which is ok. But the condition is too general and could include other communication issue. The issue is then log in exception handler:

https://github.com/zowe/api-layer/blob/606d2b3bcb9ab2b6d324c8cef52102f76055c7db/gateway-service/src/main/java/org/zowe/apiml/gateway/controllers/GatewayExceptionHandler.java#L172-L176

It generates debug message like:

A service is not available at the moment to finish request https://<GW host>:<GW port>/<path>: Service is not available at https://<service host>:<service port>

It ignores the cause of the error. It is not helpful to understand the reason of failure.

The aim of this issue is:

  • provide beter debug message
  • decide what exception could be logged as 503 and what as 500
    • 503 should be only request where is missing the remote site
    • exception about certificate (PKIX, etc.) shouldn't end with 503

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced sections of gateway-service/src/main/java/org/zowe/apiml/gateway/config/NettyRoutingFilterApiml.java and GatewayExceptionHandler.java. Trace the exception cause for failed routing and compare missing remote-site failures with certificate-related failures. Done means the debug message preserves the failure reason and only missing remote sites return 503, while certificate exceptions return 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.