caijwei opened a new issue, #12398:
URL: https://github.com/apache/apisix/issues/12398

   ### Current Behavior
   
   Restarting APISIX while it is handling continuous requests leads to 
intermittent 503 Service Unavailable responses.
   
   I have prepared a minimal reproducible setup. The file structure looks like 
this:
   
   
   ```
   ├── apisix
   │   ├── apisix.yaml
   │   └── config.yaml
   ├── nginx
   │   └── default.conf
   ├── init.sh
   ├── restart.sh
   └── test.sh
   
   ```
   
   Once unpacked, the issue can be reproduced easily on any machine that has 
Docker and curl installed.
   
   1. Run init.sh to launch Consul and the upstream NGINX container that APISIX 
will route traffic to.
   2. Run restart.sh to start APISIX.
   3. Run test.sh, which sends continuous requests to APISIX. At first, all 
responses should return HTTP status code 200.
   4. While test.sh is running, repeatedly execute restart.sh to restart APISIX.
   5. After restarting, even when the new APISIX instance is up and running 
normally, you will still see intermittent 503 errors in the output of test.sh.
   
   This indicates that APISIX fails to route traffic correctly after a restart, 
despite the upstream and service discovery being healthy.
   
   
   
   
   ### Expected Behavior
   
   After restarting APISIX, once it has successfully started and is healthy, it 
should be able to route traffic to upstream services registered in Consul 
without returning 503 errors.
   
   ### Error Logs
   
   When test.sh starts to show 503 responses, you can check the APISIX 
container logs to see detailed error messages. These logs provide insight into 
why the requests failed, such as upstream discovery or routing issues.
   
   ### Steps to Reproduce
   
   1. Unpack the minimal test setup files.
   2. Run: ./init.sh
   3. Start APISIX: ./restart.sh
   4. Start testing: ./test.sh
   5. In a separate terminal, repeatedly run: ./restart.sh
   6. Watch test.sh output — it will gradually show 503 errors.
   
   ### Environment
   
   
[apisix-debug.zip](https://github.com/user-attachments/files/21035829/apisix-debug.zip)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to