You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "tjwatson (via GitHub)" <gi...@apache.org> on 2024/11/11 16:07:57 UTC

[PR] Fix possible IllegalStateException when bundle is stopped [cxf]

tjwatson opened a new pull request, #2144:
URL: https://github.com/apache/cxf/pull/2144

   (no comment)


-- 
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: dev-unsubscribe@cxf.apache.org

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


Re: [PR] Fix possible IllegalStateException when bundle is stopped [cxf]

Posted by "tjwatson (via GitHub)" <gi...@apache.org>.
tjwatson commented on code in PR #2144:
URL: https://github.com/apache/cxf/pull/2144#discussion_r1837355401


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java:
##########
@@ -121,6 +121,16 @@ public void updated(Dictionary config) throws ConfigurationException {
             }
         }
 
+        private ServiceRegistration<?> safeRegister(String name, Object service,

Review Comment:
   I thought about that, but config admin fires events asynchronously.  Any check we do there by setting a flag or checking for the bundle state still has a window where it may be in the middle of calling the ManagedService while another thread is stopping the bundle.
   
   Regardless of what we do we should catch the exception to avoid errors getting logged by the config admin service when an exception is thrown calling out the the ManagedService.  I should have mentioned this in the issue, but all this exception does is get an error logged to the log service.  Nothing else is really broken by the exception getting thrown.  I think the easiest solution is to handle the exception and ignore 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: dev-unsubscribe@cxf.apache.org

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


Re: [PR] Fix possible IllegalStateException when bundle is stopped [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on code in PR #2144:
URL: https://github.com/apache/cxf/pull/2144#discussion_r1837265402


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java:
##########
@@ -121,6 +121,16 @@ public void updated(Dictionary config) throws ConfigurationException {
             }
         }
 
+        private ServiceRegistration<?> safeRegister(String name, Object service,

Review Comment:
   Thanks @tjwatson , I am wondering if we could implement more robust solution by relying on:
   
   ```
       @Override
       public void stop(BundleContext context) throws Exception {
   
       }
   ```
   ?



-- 
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: dev-unsubscribe@cxf.apache.org

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


Re: [PR] Fix possible IllegalStateException when bundle is stopped [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta merged PR #2144:
URL: https://github.com/apache/cxf/pull/2144


-- 
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: dev-unsubscribe@cxf.apache.org

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


Re: [PR] Fix possible IllegalStateException when bundle is stopped [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on code in PR #2144:
URL: https://github.com/apache/cxf/pull/2144#discussion_r1837265402


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java:
##########
@@ -121,6 +121,16 @@ public void updated(Dictionary config) throws ConfigurationException {
             }
         }
 
+        private ServiceRegistration<?> safeRegister(String name, Object service,

Review Comment:
   Thanks @tjwatson , I am wondering if we could implement more robust solution by relying on:
   
   ```
       @Override
       public void stop(BundleContext context) throws Exception {
   
       }
   ```
   ? Or `BundleContext::getBundle()::getState()`?



-- 
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: dev-unsubscribe@cxf.apache.org

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