tylerbertrand commented on PR #4716:
URL: https://github.com/apache/eventmesh/pull/4716#issuecomment-1879016086

   @Pil0tXia @pandaapo So the exception is caused by the fact that the 
`WatchService` is created using try-with-resources, which means the 
`WatchService` is closed prematurely as soon as the try-with-resources block is 
exited.
   
   I don't have so much domain knowledge here, but would [this latest 
commit](https://github.com/apache/eventmesh/pull/4716/commits/7bea5512676dd9972974fcc4814bed2088b41925)
 be a reasonable fix? If the watch service fails to initialize, there is 
nothing to close, so a `RuntimeException` is thrown. If it is created 
successfully, and it is the registration that fails, then when handling the 
exception, we can close the `WatchService`.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to