Skip to content

HPCC-35246 New function for deserializing all attributes#21165

Open
streeterd wants to merge 5 commits intohpcc-systems:candidate-10.2.xfrom
streeterd:HPCC-35246_New_function_to_deserializing_all_attributes
Open

HPCC-35246 New function for deserializing all attributes#21165
streeterd wants to merge 5 commits intohpcc-systems:candidate-10.2.xfrom
streeterd:HPCC-35246_New_function_to_deserializing_all_attributes

Conversation

@streeterd
Copy link
Copy Markdown
Contributor

@streeterd streeterd commented Mar 30, 2026

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

The unit tests PtreeThreadingStressTest and PTreeSerializationDeserializationTest were used to test this change.

@streeterd streeterd self-assigned this Mar 30, 2026
@github-actions
Copy link
Copy Markdown

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-35246

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-30 15:51:14 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 8222d10 to 113d12d Compare March 31, 2026 07:52
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 07:53:19 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 045c061 to 05598bb Compare March 31, 2026 09:08
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 10:32:04 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 10:33:42 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd
Copy link
Copy Markdown
Contributor Author

Performance test 35246 vs 10.2.x - release build

35246:

11:47:01.567031 80803 UNK UNK Including test PTreeBinaryTimingStressTest
.11:49:01.473298 80803 UNK UNK === BINARY TIMING COMPARISON TEST ===
11:49:01.473654 80803 UNK UNK Binary data size: 103499268 bytes
11:49:01.473660 80803 UNK UNK Iterations: 100
11:49:01.473662 80803 UNK UNK ┌──────────────────────┬─────────────────┐
11:49:01.473665 80803 UNK UNK │ Mode                 │ Avg Deserialize │
11:49:01.473667 80803 UNK UNK │                      │ (nanoseconds)   │
11:49:01.473669 80803 UNK UNK ├──────────────────────┼─────────────────┤
11:49:01.473671 80803 UNK UNK │ Binary Normal        │       318700599 │
11:49:01.473732 80803 UNK UNK │ Binary Low Memory    │       485279888 │
11:49:01.473737 80803 UNK UNK │ Binary LowMem Diff   │         +52.27% │
11:49:01.473758 80803 UNK UNK └──────────────────────┴─────────────────┘
.11:51:52.902253 80803 UNK UNK XML Normal: XML data size: 171594210 bytes
11:54:57.929717 80803 UNK UNK XML Low Memory: XML data size: 171594210 bytes
11:54:57.930014 80803 UNK UNK === XML TIMING COMPARISON TEST ===
11:54:57.930064 80803 UNK UNK Binary data size: 103499268 bytes
11:54:57.930125 80803 UNK UNK Iterations: 100
11:54:57.930137 80803 UNK UNK ┌──────────────────────┬─────────────────┐
11:54:57.930193 80803 UNK UNK │ Mode                 │ Avg Deserialize │
11:54:57.930245 80803 UNK UNK │                      │ (nanoseconds)   │
11:54:57.930269 80803 UNK UNK ├──────────────────────┼─────────────────┤
11:54:57.930276 80803 UNK UNK │ XML Normal           │      1535578235 │
11:54:57.930281 80803 UNK UNK │ XML Low Memory       │      1656952534 │
11:54:57.930285 80803 UNK UNK │ XML LowMem Diff      │          +7.90% │
11:54:57.930293 80803 UNK UNK └──────────────────────┴─────────────────┘

10.2.x

Checking out to before this change:

8076351199 HPCC-35061 Use peekStringList when reading attributes

dave@RISKAZ-06905526:~/HPCC-Platform$ git checkout 8076351199
M       vcpkg
Note: switching to '8076351199'.

Test results:

11:57:19.020323 84377 UNK UNK Including test PTreeBinaryTimingStressTest
.11:59:29.840570 84377 UNK UNK === BINARY TIMING COMPARISON TEST ===
11:59:29.840809 84377 UNK UNK Binary data size: 103499268 bytes
11:59:29.840813 84377 UNK UNK Iterations: 100
11:59:29.840815 84377 UNK UNK ┌──────────────────────┬─────────────────┐
11:59:29.840817 84377 UNK UNK │ Mode                 │ Avg Deserialize │
11:59:29.840819 84377 UNK UNK │                      │ (nanoseconds)   │
11:59:29.840820 84377 UNK UNK ├──────────────────────┼─────────────────┤
11:59:29.840822 84377 UNK UNK │ Binary Normal        │       397823479 │
11:59:29.840824 84377 UNK UNK │ Binary Low Memory    │       537491935 │
11:59:29.840826 84377 UNK UNK │ Binary LowMem Diff   │         +35.11% │
11:59:29.840831 84377 UNK UNK └──────────────────────┴─────────────────┘
.12:02:18.616131 84377 UNK UNK XML Normal: XML data size: 171594210 bytes
12:05:19.958816 84377 UNK UNK XML Low Memory: XML data size: 171594210 bytes
12:05:19.958918 84377 UNK UNK === XML TIMING COMPARISON TEST ===
12:05:19.958936 84377 UNK UNK Binary data size: 103499268 bytes
12:05:19.958938 84377 UNK UNK Iterations: 100
12:05:19.958940 84377 UNK UNK ┌──────────────────────┬─────────────────┐
12:05:19.958958 84377 UNK UNK │ Mode                 │ Avg Deserialize │
12:05:19.958963 84377 UNK UNK │                      │ (nanoseconds)   │
12:05:19.958966 84377 UNK UNK ├──────────────────────┼─────────────────┤
12:05:19.958970 84377 UNK UNK │ XML Normal           │      1513221690 │
12:05:19.958986 84377 UNK UNK │ XML Low Memory       │      1618348528 │
12:05:19.958990 84377 UNK UNK │ XML LowMem Diff      │          +6.95% │
12:05:19.959010 84377 UNK UNK └──────────────────────┴─────────────────┘

35246 vs 10.2.x comparison table:

┌────────────────────┬───────────┬───────────┬─────────┐
│ Mode               │ 35246     │ 10.2.x    │ %diff   │
├────────────────────┼───────────┼───────────┼─────────┤
│ Binary Normal      │ 318700599 │ 397823479 │ -19.89% │
│ Binary Low Memory  │ 485279888 │ 537491935 │  -9.72% │
│ Binary LowMem Diff │   +52.27% │   +35.11% │ +48.89% │
└────────────────────┴───────────┴───────────┴─────────┘

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 0360611 to 17b6ad8 Compare March 31, 2026 12:18
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 11:42:59 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 11:54:09 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 11:58:29 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-03-31 12:54:30 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd marked this pull request as ready for review April 8, 2026 08:05
@streeterd streeterd requested review from ghalliday and jakesmith April 8, 2026 08:20
Copy link
Copy Markdown
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@streeterd looks good. A few relatively minor comments/improvements.

the atom version can be further improved, but that should be a separate PR (which I suspect is your intention).

Comment thread system/jlib/jptree.cpp Outdated
v->key.setPtr(isnocase() ? AttrStr::createNC(attrName) : AttrStr::create(attrName));
if (arrayOwner)
{
CQualifierMap *map = arrayOwner->queryMap();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done outside the attribute loop, and I think arrayOwner is always null, so instead you could add

dbgassertex(!arrayOwner);

and delete this code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 3d1f417

Comment thread system/jlib/jptree.cpp Outdated
// Allocate memory for all attributes (existing + new) in one go, and copy existing attributes if needed.
unsigned insertPos = numAttrs;
AttrValue *newattrs = newAttrArray(insertPos + newAttrPairs);
if (attrs)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: You can add a dbgassert(numAttrs == 0), and remove this code. When deserializing there are never any existing values.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 3d1f417

Comment thread system/jlib/jptree.cpp Outdated
const char *attrName = base + ctx.matchOffsets[i];
const char *attrValue = base + ctx.matchOffsets[i + 1];

if (arrayOwner)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be deleted - see comment on function above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 3d1f417

Comment thread system/jlib/jptree.ipp Outdated
PtrStrUnion<HashKeyElement> name;
protected:
virtual bool removeAttribute(const char *k) override;
static CriticalSection &queryHashCrit();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: Not yet used. I don't think it needs to be here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3d1f417

Comment thread system/jlib/jptree.ipp Outdated
{
// Since most nodes have <= 15 attribute name/value pairs;
// reserve space up front to avoid reallocations.
static constexpr size32_t expectedMaximumAttributeOffsetCount = 15 * 2;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivial: no need for static

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3d1f417

@ghalliday
Copy link
Copy Markdown
Member

A decent improvement in performance.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 65a1687 to 3d1f417 Compare April 9, 2026 13:19
@streeterd streeterd requested a review from ghalliday April 9, 2026 13:21
@streeterd streeterd marked this pull request as draft April 9, 2026 13:21
1.Refactored attribute deserialization to remove unnecessary findAttribute
calls.
2.Allocate memory for all attributes instead of individually.
3.hashcrit moved from deserialization to new function queryHashCrit()

Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
2.Remove queryHashCrit() as not yet needed.
3.Remove static from constexpr as not needed.

Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 3d1f417 to 6b1cd44 Compare April 9, 2026 13:29
@streeterd streeterd marked this pull request as ready for review April 9, 2026 13:30
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-09 13:30:05 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

Copy link
Copy Markdown
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments to clean the code up, but they could be done in a follow up PR.

Comment thread system/jlib/jptree.cpp Outdated
return;

// Allocate space for existing and new attributes
AttrValue *newAttrs = (AttrValue *)realloc(attrs, (numAttrs + newAttrPairs) * sizeof(AttrValue));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbgassertex(numAttrs == 0);

then directly assign to attrs (and avoid the add in this statement.

minor: The other code in setAttribute does not verify the realloc succeeded, so no need to do so here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 9dd5fce

Comment thread system/jlib/jptree.cpp Outdated
attrs = newattrs;
numAttrs = insertPos + newAttrPairs;

// Set attribute values and update qualifier map if needed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// set attribute value. Qualifier map will never be set up, so no need to update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 9dd5fce

Comment thread system/jlib/jptree.cpp
{
const char *attrName = base + ctx.matchOffsets[i];
const char *attrValue = base + ctx.matchOffsets[i + 1];
AttrValue *v = new (&attrs[numAttrs++]) AttrValue; // Initialize new AttrValue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a later PR, it would be better to have a local variable incremented, and only assign to newAttrs once. It would be symetrical to CAtomPTree, and may avoid some memory load/stores. (It depends how clever the compiler is...)

Comment thread system/jlib/jptree.cpp Outdated
dbgassertex(numAttrs == 0);
unsigned insertPos = numAttrs;
AttrValue *newattrs = newAttrArray(insertPos + newAttrPairs);
attrs = newattrs;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: This could be cleaned up a bit. E.g. assign direct to attrs, set insertPos to 0. set numAttrs to newAttrPairs.
Fine to do in a separate PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 9dd5fce

Copy link
Copy Markdown
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@streeterd - looks like there's some build issues at the moment:

FAILED: system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o 
ccache /opt/rh/devtoolset-11/root/usr/bin/c++ -DCPPHTTPLIB_USE_POLL -DINLINE_GET_CYCLES_NOW -DJLIB_EXPORTS -DOPENTELEMETRY_ABI_VERSION_NO=1 -DPROTOBUF_USE_DLLS -DUCHAR_TYPE=uint16_t -DUSE_LIBMEMCACHED -DUSE_OPENTEL_GRPC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_NO_MYSQL_REPOSITORY -D_USE_APR -D_USE_AZURE -D_USE_CPPUNIT -D_USE_ICU -D_USE_LIBARCHIVE -D_USE_LIBXML2 -D_USE_LIBXSLT -D_USE_NUMA -D_USE_OPENLDAP -D_USE_OPENSSL -D_USE_OPENSSLV3 -D_USE_PARQUET -D_USE_ZLIB -D_USRDLL -D__USE_FILE_OFFSET64=1 -D__USE_LARGEFILE64=1 -Djlib_EXPORTS -I/hpcc-dev/HPCC-Platform/system/jlib -I/hpcc-dev/HPCC-Platform/system/win32 -I/hpcc-dev/HPCC-Platform/system/include -I/hpcc-dev/HPCC-Platform/system/lzma -I/hpcc-dev/HPCC-Platform/system/globalid -I/hpcc-dev/HPCC-Platform/system/security/shared -I/hpcc-dev/HPCC-Platform/system/security/cryptohelper -I/hpcc-dev/HPCC-Platform/system/httplib -I/hpcc-dev/build/system/jlib -I/hpcc-dev/build -I/hpcc-dev/build/oss -isystem /hpcc-dev/vcpkg_installed/x64-linux-dynamic/include -isystem /hpcc-dev/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig/../../include -frtti -fPIC -fmessage-length=0 -Werror=format -Wformat-security -Wformat-nonliteral -pthread -Wuninitialized -Werror=return-type -Werror=format-nonliteral -Wno-psabi -Wparentheses -Werror=delete-non-virtual-dtor -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -O3 -DNDEBUG -g -fno-inline-functions -g -fno-default-inline -fPIC -MD -MT system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o -MF system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o.d -o system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o -c /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:3832:6: error: no declaration matches 'void LocalPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
 3832 | void LocalPTree::deserializeAttributes(const char *base, PTreeDeserializeContext &ctx)
      |      ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:3832:6: note: no functions named 'void LocalPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
In file included from /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:46:
/hpcc-dev/HPCC-Platform/system/jlib/jptree.ipp:903:17: note: 'class LocalPTree' defined here
  903 | class jlib_decl LocalPTree : public PTree
      |                 ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:4063:6: error: no declaration matches 'void CAtomPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
 4063 | void CAtomPTree::deserializeAttributes(const char *base, PTreeDeserializeContext &ctx)
      |      ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:4063:6: note: no functions named 'void CAtomPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
In file included from /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:46:
/hpcc-dev/HPCC-Platform/system/jlib/jptree.ipp:869:17: note: 'class CAtomPTree' defined here
  869 | class jlib_decl CAtomPTree : public PTree
      |                 ^~~~~~~~~~

2.Ensured deserializeAttributes function is called in deserialization.

Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-10 08:11:16 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

2.Code cleanup in CAtomPTree::deserializeAttributes
3.Remove need to add numAttrs to newAttrPairs in
LocalPTree::deserializeAttributes

Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
@streeterd
Copy link
Copy Markdown
Contributor Author

@streeterd - looks like there's some build issues at the moment:

FAILED: system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o 
ccache /opt/rh/devtoolset-11/root/usr/bin/c++ -DCPPHTTPLIB_USE_POLL -DINLINE_GET_CYCLES_NOW -DJLIB_EXPORTS -DOPENTELEMETRY_ABI_VERSION_NO=1 -DPROTOBUF_USE_DLLS -DUCHAR_TYPE=uint16_t -DUSE_LIBMEMCACHED -DUSE_OPENTEL_GRPC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_NO_MYSQL_REPOSITORY -D_USE_APR -D_USE_AZURE -D_USE_CPPUNIT -D_USE_ICU -D_USE_LIBARCHIVE -D_USE_LIBXML2 -D_USE_LIBXSLT -D_USE_NUMA -D_USE_OPENLDAP -D_USE_OPENSSL -D_USE_OPENSSLV3 -D_USE_PARQUET -D_USE_ZLIB -D_USRDLL -D__USE_FILE_OFFSET64=1 -D__USE_LARGEFILE64=1 -Djlib_EXPORTS -I/hpcc-dev/HPCC-Platform/system/jlib -I/hpcc-dev/HPCC-Platform/system/win32 -I/hpcc-dev/HPCC-Platform/system/include -I/hpcc-dev/HPCC-Platform/system/lzma -I/hpcc-dev/HPCC-Platform/system/globalid -I/hpcc-dev/HPCC-Platform/system/security/shared -I/hpcc-dev/HPCC-Platform/system/security/cryptohelper -I/hpcc-dev/HPCC-Platform/system/httplib -I/hpcc-dev/build/system/jlib -I/hpcc-dev/build -I/hpcc-dev/build/oss -isystem /hpcc-dev/vcpkg_installed/x64-linux-dynamic/include -isystem /hpcc-dev/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig/../../include -frtti -fPIC -fmessage-length=0 -Werror=format -Wformat-security -Wformat-nonliteral -pthread -Wuninitialized -Werror=return-type -Werror=format-nonliteral -Wno-psabi -Wparentheses -Werror=delete-non-virtual-dtor -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -O3 -DNDEBUG -g -fno-inline-functions -g -fno-default-inline -fPIC -MD -MT system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o -MF system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o.d -o system/jlib/CMakeFiles/jlib.dir/jptree.cpp.o -c /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:3832:6: error: no declaration matches 'void LocalPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
 3832 | void LocalPTree::deserializeAttributes(const char *base, PTreeDeserializeContext &ctx)
      |      ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:3832:6: note: no functions named 'void LocalPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
In file included from /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:46:
/hpcc-dev/HPCC-Platform/system/jlib/jptree.ipp:903:17: note: 'class LocalPTree' defined here
  903 | class jlib_decl LocalPTree : public PTree
      |                 ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:4063:6: error: no declaration matches 'void CAtomPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
 4063 | void CAtomPTree::deserializeAttributes(const char *base, PTreeDeserializeContext &ctx)
      |      ^~~~~~~~~~
/hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:4063:6: note: no functions named 'void CAtomPTree::deserializeAttributes(const char*, PTreeDeserializeContext&)'
In file included from /hpcc-dev/HPCC-Platform/system/jlib/jptree.cpp:46:
/hpcc-dev/HPCC-Platform/system/jlib/jptree.ipp:869:17: note: 'class CAtomPTree' defined here
  869 | class jlib_decl CAtomPTree : public PTree
      |                 ^~~~~~~~~~

@jakesmith should be fixed in aff3127

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-10 08:40:49 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

Copy link
Copy Markdown
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Still some scope for cleaning the code up, but no reason not to merge.

Copy link
Copy Markdown
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@streeterd - please see comments.

Comment thread system/jlib/jptree.cpp
const char *attrValue = base + ctx.matchOffsets[i + 1];
AttrValue *v = &newattrs[insertPos++];

if (!v->key.set(attrName))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attrHT needs protecting (as setAtttribute does).
To optimize, you could delay until needed in this needed (CLeavableCriticalBlock is likely helpful here).

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.cpp Outdated
attrs = newattrs;
numAttrs = insertPos + newAttrPairs;

// Set attribute values and update qualifier map if needed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment generated by copilot]


correctness: Stale comment

The comment says "update qualifier map if needed" but the qualifier map is never updated (correctly so, given dbgassertex(!arrayOwner) above). Gavin already suggested a clearer replacement:

// Qualifier map will never be set up during deserialization, so no need to update.

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.cpp Outdated
return;

// Allocate space for existing and new attributes
AttrValue *newAttrs = (AttrValue *)realloc(attrs, (numAttrs + newAttrPairs) * sizeof(AttrValue));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment generated by copilot]


style: Inconsistent variable naming

This uses newAttrs (camelCase) while the CAtomPTree version at line 4072 uses newattrs (lowercase), which matches the existing setAttribute() convention. Consider aligning to newattrs for consistency.

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.cpp Outdated
dbgassertex(numAttrs == 0);
unsigned insertPos = 0; // Position to insert new attributes
AttrValue *newattrs = newAttrArray(insertPos + newAttrPairs);
attrs = newattrs;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attrs could be non-null, i.e. IPropertyTree::deserialize could at least theorectically be called on a tree with content already, so it should free it (freeAttrArray).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With comment #21165 (comment) attrs is now asserted as null.

Comment thread system/jlib/jptree.cpp Outdated
// Allocate memory for all attributes (existing + new) in one go, and copy existing attributes if needed.
dbgassertex(numAttrs == 0);
unsigned insertPos = 0; // Position to insert new attributes
AttrValue *newattrs = newAttrArray(insertPos + newAttrPairs);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs protecting (as setAttribute does)

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.hpp Outdated
virtual void serializeToStream(IBufferedSerialOutputStream &out) const = 0;
virtual void deserializeFromStream(IBufferedSerialInputStream &in, PTreeDeserializeContext &ctx) = 0;

virtual void deserializeAttributes(const char *base, PTreeDeserializeContext &ctx) = 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't need to be a exposed member of the interface (and it's at odds with the fact the concrete imlps. are in "protected".). It is and internal method only.

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.cpp
VStringBuffer err("PTree deserialization error: out of memory reading attributes, numAttrs=%u, newAttrPairs=%u", numAttrs, newAttrPairs);
throwUnexpectedX(err.str());
}
attrs = newAttrs;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's nothing currently stopping IPT::deserialize (and hence this) being called on a tree with content, so 'attrs' may be non-null (and arrayOwner too).

I think in practice it is assumed that deserialize is always called on an empty tree though, so it's okay.
But if it's going to assert on dbgassertex(!arrayOwner), it should also dbgassertex(!attr) it should do so early on, and (be in unlikely wrappers), with a comment saying deserialize only supproted on empty tree.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not directly wrap dbgassertex in an unlikely wrapper so I turned them into unlikely ifs.

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

Comment thread system/jlib/jptree.cpp Outdated
value = nullptr;
}

void PTree::deserializeAttributes(const char *base, PTreeDeserializeContext &ctx)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this implementation for? LocalPTree and CAtomPTree need a flavour of this, but nothing calls this version, and like PTree::setAttribute, this one should be left as abstract.

Copy link
Copy Markdown
Contributor Author

@streeterd streeterd Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0b62fc4

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-13 15:56:59 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 214a012 to a298496 Compare April 14, 2026 07:54
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 07:54:45 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 87979ed to 1c43a82 Compare April 14, 2026 07:59
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 07:59:38 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 08:00:21 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 1c43a82 to b05ef2b Compare April 14, 2026 12:57
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 12:58:13 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from b05ef2b to 8dd6e99 Compare April 14, 2026 13:08
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 13:09:01 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

2.Ensure comments are correct
3.Correct variable name newattrs to newAttrs
4.Ensure deserializeAttributes is an internal method
5.Set dbgassertex as unlikely
6.Remove PTree::deserializeAttributes(...) as unused

Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
@streeterd streeterd force-pushed the HPCC-35246_New_function_to_deserializing_all_attributes branch from 8dd6e99 to 0b62fc4 Compare April 14, 2026 13:35
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21165 - HPCC-35246 New function for deserializing all attributes
Base Branch: candidate-10.2.x
Test Time: 2026-04-14 13:35:52 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants