Skip to content

[HZ-5434] FencedLock for Asyncio#818

Merged
yuce merged 29 commits into
hazelcast:masterfrom
yuce:asyncio-fenced-lock
Jun 18, 2026
Merged

[HZ-5434] FencedLock for Asyncio#818
yuce merged 29 commits into
hazelcast:masterfrom
yuce:asyncio-fenced-lock

Conversation

@yuce

@yuce yuce commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Ported FencedLock proxy to asyncio.

The asyncore variant uses actual thread IDs to disable re-entrancy.
That's not useful with the asyncio variant, so currently the thread ID 0 is used when necessary.
I've omitted docs that refer to threads, and tests that use threads.
I'll push another PR to add those after lock context implementation.

@codecov-commenter

codecov-commenter commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.65896% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.10%. Comparing base (1a7c4f5) to head (8453658).

Files with missing lines Patch % Lines
hazelcast/internal/asyncio_proxy/fenced_lock.py 81.16% 29 Missing ⚠️
hazelcast/internal/asyncio_proxy/cp_manager.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #818      +/-   ##
==========================================
- Coverage   94.18%   94.10%   -0.08%     
==========================================
  Files         411      412       +1     
  Lines       27513    27686     +173     
==========================================
+ Hits        25912    26054     +142     
- Misses       1601     1632      +31     

☔ View full report in Codecov by Harness.
📢 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.

@yuce yuce requested a review from emreyigit June 8, 2026 09:04
@emreyigit

Copy link
Copy Markdown
Member

How are you going to protect lock ownership without thread id? There will be concurrent runs, right?

@yuce

yuce commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

How are you going to protect lock ownership without thread id? There will be concurrent runs, right?

The lock is reentrant for lock attempts with the same client, similar to the Node.js client, so data races will happen with operations that uses the same client.
I'll push another PR that uses a pseudo-task ID to be used instead of the thread ID, which will enable us to distinguish between tasks.

@yuce yuce added this to the 5.7.0 milestone Jun 15, 2026
@yuce

yuce commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

The SSL tests with Python 3.13 + Windows fail, but that's unrelated to this PR.
Both asyncore and asyncio SSL tests fail.

@yuce yuce merged commit 23092ac into hazelcast:master Jun 18, 2026
15 of 17 checks passed
@yuce yuce deleted the asyncio-fenced-lock branch June 18, 2026 11:50
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