[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17457068#comment-17457068 ] Nikolay Izhikov commented on IGNITE-16057: -- [~vermakov] Yes. I will take a look shortly. > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Assignee: Vladimir Ermakov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17457065#comment-17457065 ] Taras Ledkov commented on IGNITE-16057: --- [~vermakov], the patch is OK with me. > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Assignee: Vladimir Ermakov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17457064#comment-17457064 ] Vladimir Ermakov commented on IGNITE-16057: --- Hello [~nizhikov] [~tledkov-gridgain]! Could you please have a look at the patch? > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Assignee: Vladimir Ermakov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17456664#comment-17456664 ] Ignite TC Bot commented on IGNITE-16057: {panel:title=Branch: [pull/9630/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel} {panel:title=Branch: [pull/9630/head] Base: [master] : New Tests (8)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1} {color:#8b}Binary Objects{color} [[tests 8|https://ci.ignite.apache.org/viewLog.html?buildId=6314046]] * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalSelfTest.testArrayFieldSeveralRead[useBinaryArrays = true] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalNonCompactSelfTest.testArrayFieldSeveralRead[useBinaryArrays = false] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalNonCompactSelfTest.testArrayFieldSeveralRead[useBinaryArrays = true] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalSelfTest.testArrayFieldSeveralRead[useBinaryArrays = false] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryUtilsSelfTest.testDeserializedAndUnmrshalledMap - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryUtilsSelfTest.testDeserializedAndUnmrshalledObject - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryUtilsSelfTest.testDeserializedAndUnmrshalledCollection - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryUtilsSelfTest.testDeserializedAndUnmrshalledArray - PASSED{color} {panel} [TeamCity *--> Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=6314131&buildTypeId=IgniteTests24Java8_RunAll] > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Assignee: Vladimir Ermakov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454801#comment-17454801 ] Ignite TC Bot commented on IGNITE-16057: {panel:title=Branch: [pull/9630/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel} {panel:title=Branch: [pull/9630/head] Base: [master] : New Tests (4)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1} {color:#8b}Binary Objects{color} [[tests 4|https://ci.ignite.apache.org/viewLog.html?buildId=6310012]] * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalSelfTest.testArrayFieldSeveralRead[useBinaryArrays = true] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalNonCompactSelfTest.testArrayFieldSeveralRead[useBinaryArrays = false] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalNonCompactSelfTest.testArrayFieldSeveralRead[useBinaryArrays = true] - PASSED{color} * {color:#013220}IgniteBinaryObjectsTestSuite: BinaryObjectBuilderAdditionalSelfTest.testArrayFieldSeveralRead[useBinaryArrays = false] - PASSED{color} {panel} [TeamCity *--> Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=6310097&buildTypeId=IgniteTests24Java8_RunAll] > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Assignee: Vladimir Ermakov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (IGNITE-16057) Second read of array field from BinaryObject fail
[ https://issues.apache.org/jira/browse/IGNITE-16057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453985#comment-17453985 ] Nikolay Izhikov commented on IGNITE-16057: -- Reproducer with the usage of public API, only: {code:java} /** */ @Test public void testArrayFieldSeveralRead() throws Exception { try (Ignite ignite = startGrid(1)) { TestClass1[] expArr = new TestClass1[] {new TestClass1(), new TestClass1()}; BinaryObject arrObj = ignite.binary().toBinary(new TestClsWithArray(expArr)); for (int i = 0; i < 10; i++) Assert.assertArrayEquals(i + " iteration", expArr, unwrapBinariesInArray(arrObj.field("arr"))); arrObj = ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", expArr).build(); for (int i = 0; i < 10; i++) Assert.assertArrayEquals(i + " iteration", expArr, unwrapBinariesInArray(arrObj.field("arr"))); } finally { clearBinaryMeta(); } } {code} > Second read of array field from BinaryObject fail > - > > Key: IGNITE-16057 > URL: https://issues.apache.org/jira/browse/IGNITE-16057 > Project: Ignite > Issue Type: Bug >Reporter: Nikolay Izhikov >Priority: Blocker > Labels: ise > > Second read of array field fail and read some garbage. > This happen because when object read with handle stream position don't move > to the end of already deserialized object. > So second array element is just random bytes from the middle of the stream. > BinaryObjectBuilderAdditionalSelfTest > {code:java} > /** */ > @Test > public void testArrayFieldSeveralRead() throws Exception { > try (Ignite ignite = startGrid(1)) { > TestClass1[] expArr = new TestClass1[] {new TestClass1(), new > TestClass1()}; > BinaryObject arrObj = ignite.binary().toBinary(new > TestClsWithArray(expArr)); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > arrObj = > ignite.binary().builder(TestClsWithArray.class.getName()).setField("arr", > expArr).build(); > for (int i = 0; i < 10; i++) > Assert.assertArrayEquals(i + " iteration", expArr, > PlatformUtils.unwrapBinariesInArray(arrObj.field("arr"))); > } > finally { > clearBinaryMeta(); > } > } > /** Test class with array. */ > public static class TestClsWithArray { > /** */ > private final Object[] arr; > /** */ > public TestClsWithArray(TestClass1[] arr) { > this.arr = arr; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)