This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 5a570508dfd IGNITE-27886 .NET: Fix unknown protocol feature decoding
(#7612)
5a570508dfd is described below
commit 5a570508dfdcc4ee5d138bee36581dd0e6a7c769
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Tue Feb 17 17:36:08 2026 +0200
IGNITE-27886 .NET: Fix unknown protocol feature decoding (#7612)
Do not fail on long bitsets, ignore unknown bits.
---
.../Proto/ProtocolBitmaskFeatureExtensionsTest.cs | 14 +++++++++-----
.../Internal/Proto/ProtocolBitmaskFeatureExtensions.cs | 5 -----
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ProtocolBitmaskFeatureExtensionsTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ProtocolBitmaskFeatureExtensionsTest.cs
index e9905c916de..e690fbdb742 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ProtocolBitmaskFeatureExtensionsTest.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ProtocolBitmaskFeatureExtensionsTest.cs
@@ -17,7 +17,6 @@
namespace Apache.Ignite.Tests.Proto;
-using System;
using Internal.Proto;
using NUnit.Framework;
@@ -142,12 +141,17 @@ public class ProtocolBitmaskFeatureExtensionsTest
}
[Test]
- public void TestFromBytesWithMoreThanFourBytesThrows()
+ public void TestFromBytesWithMoreThanFourBytesIgnoresUnknownFeatures()
{
- byte[] bytes = [1, 2, 3, 4, 5];
+ byte[] bytes = [7, 0, 0, 0, 255, 255];
- var ex = Assert.Throws<InvalidOperationException>(() =>
ProtocolBitmaskFeatureExtensions.FromBytes(bytes));
- StringAssert.Contains("Invalid bitmask feature length: 5",
ex!.Message);
+ var features = ProtocolBitmaskFeatureExtensions.FromBytes(bytes);
+
+ var expected = ProtocolBitmaskFeature.UserAttributes |
+ ProtocolBitmaskFeature.TableReqsUseQualifiedName |
+ ProtocolBitmaskFeature.TxDirectMapping;
+
+ Assert.AreEqual(expected, features);
}
[Test]
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/ProtocolBitmaskFeatureExtensions.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/ProtocolBitmaskFeatureExtensions.cs
index d43551c96b5..96ac35c9f2d 100644
---
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/ProtocolBitmaskFeatureExtensions.cs
+++
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/ProtocolBitmaskFeatureExtensions.cs
@@ -46,11 +46,6 @@ internal static class ProtocolBitmaskFeatureExtensions
/// <returns>Flags.</returns>
public static ProtocolBitmaskFeature FromBytes(ReadOnlySpan<byte> bytes)
{
- if (bytes.Length > 4)
- {
- throw new InvalidOperationException("Invalid bitmask feature
length: " + bytes.Length);
- }
-
if (bytes.Length < 4)
{
// Pad with zeros if less than 4 bytes.