You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/04/27 02:51:54 UTC

[GitHub] [eventmesh] Alonexc opened a new issue, #3830: [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl]

Alonexc opened a new issue, #3830:
URL: https://github.com/apache/eventmesh/issues/3830

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://user-images.githubusercontent.com/91315508/234747254-aa8ee4bd-55c7-4cee-8b4c-4d9619e75bdb.png)
   ![image](https://user-images.githubusercontent.com/91315508/234747273-b548da1d-3cfe-4e42-86d5-96415238b5e7.png)
   located at:
   eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/java/org/apache/eventmesh/storage/rocketmq/producer/ProducerImpl.java line 85,99,113,140,
   analysis and explanation:
   InterruptedExceptions should never be ignored in the code, and simply logging the exception counts in this case as "ignoring". The throwing of the InterruptedException clears the interrupted state of the Thread, so if the exception is not handled properly the information that the thread was interrupted will be lost. Instead, InterruptedExceptions should either be rethrown - immediately or after cleaning up the method’s state - or the thread should be re-interrupted by calling Thread.interrupt() even if this is supposed to be a single-threaded application. Any other course of action risks delaying thread shutdown and loses the information that the thread was interrupted - probably without finishing its task.
   Similarly, the ThreadDeath exception should also be propagated. According to its JavaDoc:
   If ThreadDeath is caught by a method, it is important that it be rethrown so that the thread actually dies.
   
   
   ### Describe the solution you'd like
   
   Just for reference, if you have better modifications, please correct me:
   ![image](https://user-images.githubusercontent.com/91315508/234747324-4406c296-9d3b-4499-92fd-2527089533e7.png)
   
   Remove this useless assignment; "msg" already holds the assigned value along all execution paths.
   ![image](https://user-images.githubusercontent.com/91315508/234747352-bb8d733c-5222-4d81-bd57-a79ab02fb7a1.png)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: issues-unsubscribe@eventmesh.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-2002388044

   @j1803248734 You are welcome to submit a PR.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] pandaapo commented on issue #3830: [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl]

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-1533064231

   About removing `supplySysProp(msg, cloudEvent)`, I have a different opinion. In method `supplySysProp(msg, cloudEvent)`, the `Message` object seems to be set more value than before calling `supplySysProp(msg, cloudEvent)`. I'm not sure the reason of deleting it.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "jevinjiang (via GitHub)" <gi...@apache.org>.
jevinjiang commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-2005612950

   I observed that the sendOneway, sendAsync, and reply methods did not return the sendResult object. Why does the send method need to return it? 


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "j1803248734 (via GitHub)" <gi...@apache.org>.
j1803248734 commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-2002052895

   Can I work on this issue? kindly assign it to me!
   
   


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-2006653899

   > I observed that the sendOneway, sendAsync, and reply methods did not return the sendResult object. Why does the send method need to return it?
   
   @jevinjiang 
   Neither `sendOneway` nor `sendAsync` need to be concerned with the returned response, unlike the `send` method.
   
   `sendOneway`和`sendAsync`都不需要关注返回的响应,和`send`方法不同。


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "jevinjiang (via GitHub)" <gi...@apache.org>.
jevinjiang commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-2002437440

   Completed, pull request submitted, please review.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] Alonexc commented on issue #3830: [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl]

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-1533929893

   ![image](https://user-images.githubusercontent.com/91315508/236083176-f20dc606-e422-4327-bded-fce707a60970.png)
   Instead of removing `supplySysProp(msg, cloudEvent)`, we remove the intermediate quantity `msg`. The method itself returns the value of this allocation.
   ![image](https://user-images.githubusercontent.com/91315508/236083424-17af2439-37ca-4fa8-8d94-46881be9adcb.png)
   


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl] (eventmesh)

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm closed issue #3830: [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl]
URL: https://github.com/apache/eventmesh/issues/3830


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] pandaapo commented on issue #3830: [Enhancement] InterruptedExceptions should not be ignored in the code.[ProducerImpl]

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo commented on issue #3830:
URL: https://github.com/apache/eventmesh/issues/3830#issuecomment-1533940426

   Ooops. I misunderstood your meaning. Thanks.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org