From 0c8894a89402c0e908fb2c2534ba41f0c6412a0f Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Wed, 5 Feb 2025 17:01:31 -0500 Subject: [PATCH] Add Ice.Warn.Executor --- config/PropertyNames.xml | 1 + cpp/src/Ice/PropertyNames.cpp | 3 ++- csharp/src/Ice/Internal/PropertiesAdminI.cs | 26 +++---------------- csharp/src/Ice/Internal/PropertyNames.cs | 1 + csharp/src/Ice/Internal/ThreadPool.cs | 4 +-- .../java/com/zeroc/Ice/PropertyNames.java | 1 + 6 files changed, 11 insertions(+), 25 deletions(-) diff --git a/config/PropertyNames.xml b/config/PropertyNames.xml index 1b9661f2dd0..ba2b141c1bb 100644 --- a/config/PropertyNames.xml +++ b/config/PropertyNames.xml @@ -156,6 +156,7 @@ + diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index 2dde14b5177..e49b89eeebd 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -193,6 +193,7 @@ const Property IcePropsData[] = Property{"Warn.Datagrams", "0", false, false, nullptr}, Property{"Warn.Dispatch", "1", false, false, nullptr}, Property{"Warn.Endpoints", "1", false, false, nullptr}, + Property{"Warn.Executor", "1", false, false, nullptr}, Property{"Warn.UnusedProperties", "0", false, false, nullptr} }; @@ -202,7 +203,7 @@ const PropertyArray PropertyNames::IceProps .prefixOnly=false, .isOptIn=false, .properties=IcePropsData, - .length=84 + .length=85 }; const Property IceMXPropsData[] = diff --git a/csharp/src/Ice/Internal/PropertiesAdminI.cs b/csharp/src/Ice/Internal/PropertiesAdminI.cs index af22f693736..58602220661 100644 --- a/csharp/src/Ice/Internal/PropertiesAdminI.cs +++ b/csharp/src/Ice/Internal/PropertiesAdminI.cs @@ -166,32 +166,14 @@ public override void // Copy callbacks to allow callbacks to update callbacks foreach (var callback in new List(_deprecatedUpdateCallbacks)) { - try - { - callback.updated(changes); - } - catch (System.Exception ex) - { - if (_properties.getIcePropertyAsInt("Ice.Warn.Dispatch") > 1) - { - _logger.warning("properties admin update callback raised unexpected exception:\n" + ex); - } - } + // The callback should not throw any exception. + callback.updated(changes); } // Copy callbacks to allow callbacks to update callbacks foreach (var callback in new List>>(_updateCallbacks)) { - try - { - callback(changes); - } - catch (System.Exception ex) - { - if (_properties.getIcePropertyAsInt("Ice.Warn.Dispatch") > 1) - { - _logger.warning("properties admin update callback raised unexpected exception:\n" + ex); - } - } + // The callback should not throw any exception. + callback(changes); } } } diff --git a/csharp/src/Ice/Internal/PropertyNames.cs b/csharp/src/Ice/Internal/PropertyNames.cs index 7056dcc7e02..78055db2006 100644 --- a/csharp/src/Ice/Internal/PropertyNames.cs +++ b/csharp/src/Ice/Internal/PropertyNames.cs @@ -158,6 +158,7 @@ internal sealed class PropertyNames new(pattern: @"Warn.Datagrams", usesRegex: false, defaultValue: "0", deprecated: false, propertyArray: null), new(pattern: @"Warn.Dispatch", usesRegex: false, defaultValue: "1", deprecated: false, propertyArray: null), new(pattern: @"Warn.Endpoints", usesRegex: false, defaultValue: "1", deprecated: false, propertyArray: null), + new(pattern: @"Warn.Executor", usesRegex: false, defaultValue: "1", deprecated: false, propertyArray: null), new(pattern: @"Warn.UnusedProperties", usesRegex: false, defaultValue: "0", deprecated: false, propertyArray: null), new(pattern: @"CacheMessageBuffers", usesRegex: false, defaultValue: "2", deprecated: false, propertyArray: null) ]); diff --git a/csharp/src/Ice/Internal/ThreadPool.cs b/csharp/src/Ice/Internal/ThreadPool.cs index b304a609d0f..cde44f23581 100644 --- a/csharp/src/Ice/Internal/ThreadPool.cs +++ b/csharp/src/Ice/Internal/ThreadPool.cs @@ -333,9 +333,9 @@ public void executeFromThisThread(System.Action call, Ice.Connection connection) } catch (System.Exception ex) { - if (_instance.initializationData().properties.getIcePropertyAsInt("Ice.Warn.Dispatch") > 0) + if (_instance.initializationData().properties.getIcePropertyAsInt("Ice.Warn.Executor") > 0) { - _instance.initializationData().logger.warning("dispatch exception:\n" + ex); + _instance.initializationData().logger.warning($"executor exception:\n{ex}"); } } } diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java index 9eabf95aaa0..edce320434e 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/PropertyNames.java @@ -162,6 +162,7 @@ final class PropertyNames new Property("Warn.Datagrams", false, "0", false, null), new Property("Warn.Dispatch", false, "1", false, null), new Property("Warn.Endpoints", false, "1", false, null), + new Property("Warn.Executor", false, "1", false, null), new Property("Warn.UnusedProperties", false, "0", false, null), new Property("CacheMessageBuffers", false, "2", false, null) });