Aias00 opened a new issue, #2000:
URL: https://github.com/apache/rocketmq-dashboard/issues/2000

   ### Before Creating the Issue
   
   - [x] I have searched the existing issues and pull requests.
   - [x] I have reproduced the problem on the latest `rocketmq-studio` branch.
   
   ### Description
   
   `InstanceService.deleteInstance` checks that an instance exists and has no 
managed resources before deleting it. However, `InstanceRepository.deleteById` 
returns `void`, and `MybatisPlusInstanceRepository` discards the affected-row 
count from MyBatis-Plus.
   
   If two requests delete the same instance concurrently, both can pass the 
initial existence/resource checks. The second delete then removes zero rows but 
still returns success, releases the runtime AdminClient endpoint, and records a 
successful `DELETE_INSTANCE` audit event.
   
   ### Expected behavior
   
   A delete that affects zero rows should be treated as a concurrently removed 
instance:
   
   - return a structured `404` response;
   - do not release runtime clients;
   - do not record a successful deletion audit.
   
   ### Suggested fix
   
   Return the delete outcome from `InstanceRepository.deleteById`, check it in 
`InstanceService`, and map a zero-row result to `404` before any post-delete 
side effects.
   
   ### Reproduction / regression test
   
   1. Stub `findById` to return an existing instance.
   2. Stub resource counts to zero.
   3. Make repository deletion report zero affected rows.
   4. Call `deleteInstance`.
   5. Assert `404` and verify no AdminClient release or successful audit.
   
   ### Scope
   
   RocketMQ Studio Track 1: instance lifecycle and control-plane correctness.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to