Skip to content

[CLIENT-4834] Fix memory error when shared memory is enabled and server version is read before sending user agent string#1067

Draft
juliannguyen4 wants to merge 14 commits into
devfrom
CLIENT-4834-fix-memory-error-from-user-agent-and-shared-memory
Draft

[CLIENT-4834] Fix memory error when shared memory is enabled and server version is read before sending user agent string#1067
juliannguyen4 wants to merge 14 commits into
devfrom
CLIENT-4834-fix-memory-error-from-user-agent-and-shared-memory

Conversation

@juliannguyen4
Copy link
Copy Markdown
Collaborator

@juliannguyen4 juliannguyen4 commented May 18, 2026

TODO

  • shm_key client config default was changed... also address other C client api changes

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.44%. Comparing base (da9715f) to head (8bba73b).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1067   +/-   ##
=======================================
  Coverage   84.44%   84.44%           
=======================================
  Files          99       99           
  Lines       14062    14062           
=======================================
  Hits        11874    11874           
  Misses       2188     2188           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@juliannguyen4
Copy link
Copy Markdown
Collaborator Author

juliannguyen4 commented May 19, 2026

  1. New shared memory tests are failing on this feature branch when run locally with a locally built wheel.
FAILED new_tests/test_shared_memory.py::TestSharedMemory::test_one_client - exception.ClientError: (-1, 'Shared memory get failed: Invalid argument pid: 3370468', 'src/main/aerospike/as_shm_cluster.c', 920, False)
FAILED new_tests/test_shared_memory.py::TestSharedMemory::test_multiple_clients - exception.ClientError: (-1, 'Shared memory get failed: Invalid argument pid: 3370468', 'src/main/aerospike/as_shm_cluster.c', 920, False)

Resolved by deleting the existing shared memory segment locally. But when rerunning without deleting the shared memory segment, a crash occurs.

  • Crash doesn't occur when using unoptimized build

  • This behavior also happens if only running "test_one_client" test case

  • Updating hardcoded SHM key in python client to the default one in the c client does not fix this crash

  • When debugging with GDB, config->shm_key looks correct

  1. Using branch CLIENT-4834-test-without-fix, was unable to reproduce memory error on github actions, but can reproduce it locally with that branch and a locally built wheel

… one in the docstring for as_config doesn't match the implementation
…tops the test from crashing, remove this default shm key so we don't need to manually update it if the c client updates the default one (e.g in this PR)
…000000 stops the test from crashing, remove this default shm key so we don't need to manually update it if the c client updates the default one (e.g in this PR)"

This reverts commit aec7da9.
…ent instance if they use the same host seeds
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.

2 participants