Skip to content

Commit

Permalink
Add Ice.Warn.Executor
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Feb 5, 2025
1 parent d0533d0 commit 0c8894a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 25 deletions.
1 change: 1 addition & 0 deletions config/PropertyNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<property name="Warn.Datagrams" languages="cpp,csharp,java" default="0" />
<property name="Warn.Dispatch" languages="all" default="1" />
<property name="Warn.Endpoints" languages="all" default="1" />
<property name="Warn.Executor" languages="cpp,csharp,java" default="1" />
<property name="Warn.UnusedProperties" languages="all" default="0" />
<property name="CacheMessageBuffers" languages="csharp,java" default="2" />
</section>
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/Ice/PropertyNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};

Expand All @@ -202,7 +203,7 @@ const PropertyArray PropertyNames::IceProps
.prefixOnly=false,
.isOptIn=false,
.properties=IcePropsData,
.length=84
.length=85
};

const Property IceMXPropsData[] =
Expand Down
26 changes: 4 additions & 22 deletions csharp/src/Ice/Internal/PropertiesAdminI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,32 +166,14 @@ public override void
// Copy callbacks to allow callbacks to update callbacks
foreach (var callback in new List<Ice.PropertiesAdminUpdateCallback>(_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<System.Action<Dictionary<string, string>>>(_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);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions csharp/src/Ice/Internal/PropertyNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]);
Expand Down
4 changes: 2 additions & 2 deletions csharp/src/Ice/Internal/ThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
Expand Down

0 comments on commit 0c8894a

Please sign in to comment.