Clients that disallow async operations cannot sync with servers that allow them
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, databases, distributed-systems
Hướng nghiên cứu
Read morango/sync/context.py around CompositeSessionContext.__init__, then trace how SyncClient builds the context and how the operations use its child contexts. Reproduce the push and pull failures by reducing client capabilities in tests/testapp/tests/integration/test_network_characterization.py; done means both syncs pass against a server with full capabilities and the legacy server request flow remains unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Observed Behavior
A client with MORANGO_DISALLOW_ASYNC_OPERATIONS = True cannot sync with a server that has ASYNC_OPERATIONS. Both push and pull fail with a 500 response from the server.
- Push: The client's capabilities header omits
ASYNC_OPERATIONS, so the server uses the legacy flow and serializes when the client creates the transfer session. But the client's operations still seeASYNC_OPERATIONSand run the async flow. The client reads the remote transfer session for the serializing and queuing stages, finds the server already past them, and never sendsrecords_total. The first buffer POST then fails on the server becauserecords_totalisNone. - Pull: The client creates the remote transfer session before it serializes, so it sends
client_fsic='{}'. Both sides haveFSIC_V2_FORMAT, so the server queues with the v2 format when the client creates the transfer session. The v2 queuing rejects the empty FSIC, and the create request fails.
Expected Behavior
A client that disallows async operations can push and pull with a server that allows them. Both sides agree on whether the sync uses the async flow, and the server receives the data it needs (records_total for a push, a valid client_fsic for a pull) before it queues or accepts buffers.
Steps to Reproduce
- Run a server with the default settings, so its capabilities include
ASYNC_OPERATIONSandFSIC_V2_FORMAT. - Configure a client with
MORANGO_DISALLOW_ASYNC_OPERATIONS = True. - Start a sync session from the client and run a push with at least one record. The first
POST api/morango/v1/buffers/returns 500. - Start a sync session from the client and run a pull.
POST api/morango/v1/transfersessions/returns 500.
To reproduce in the test suite, patch morango.utils.CAPABILITIES and morango.sync.context.CAPABILITIES to drop ASYNC_OPERATIONS around a push or pull in tests/testapp/tests/integration/test_network_characterization.py. The live server keeps its full set of capabilities.
Minimal Reproduction Environment / Conditions
- Version / Branch / Commit:
release-v0.9.x(found on the branch for #364, based on2b8a92b) - Configuration / Environment: SQLite, Python 3.10, live server test harness (
BasePushPullClientTestCase)
Errors, Logs & Telemetry
Push, on the server:
File "morango/api/viewsets.py", line 478, in create
raise context.error
File "morango/sync/operations.py", line 663, in handle
if context.transfer_session.records_total > 0:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
"POST /api/morango/v1/buffers/ HTTP/1.1" 500
Requests from the client during the push (the two GETs come from the async flow's stage checks):
POST api/morango/v1/transfersessions/
GET api/morango/v1/transfersessions/<id>/
GET api/morango/v1/transfersessions/<id>/
POST api/morango/v1/buffers/ -> 500
Pull, on the server:
File "morango/api/viewsets.py", line 382, in create
raise context.error
File "morango/sync/operations.py", line 568, in handle
_queue_into_buffer_v2(context.transfer_session)
File "morango/sync/operations.py", line 214, in _queue_into_buffer_v2
assert "sub" in client_fsic
AssertionError
"POST /api/morango/v1/transfersessions/ HTTP/1.1" 500
Deliverables & Testing Requirements
- A client that disallows async operations completes a push and a pull with a server that allows them.
- The operations that run on the client agree with the capabilities the client sends to the server.
- Regression Safety: Add integration tests for push and pull with the client capabilities reduced and the server at its full set. The characterization suite from #363 and #364 shows the request lists to extend.
Technical Pointers & Root Cause Clues
- Suspected Components:
morango/sync/context.py:378:CompositeSessionContext.__init__passes thecapabilitieskwarg to its child contexts before the kwarg is intersected with the localCAPABILITIES. The composite's owncapabilitiesis intersected, but the children keep the server's full list, and the operations run against the children.morango/sync/syncsession.py:630:SyncClientbuilds the composite context fromserver_info["capabilities"].morango/sync/operations.py:905(LegacyNetworkInitializeOperation): the client creates the remote transfer session in the initializing stage, before the local serializing stage setsclient_fsic.morango/api/viewsets.py:449: the server picks the legacy flow when the client's header lacksASYNC_OPERATIONS.
- Related Issues / PRs: Found while writing #364. The #364 tests use a server that emulates a version before 0.6.0 instead of reducing only the client capabilities.
Notes & Edge Cases
- Legacy servers: Against a real server before 0.6.0 (no
ASYNC_OPERATIONS, noFSIC_V2_FORMAT), both syncs complete. But the pull still sends an emptyclient_fsic, so the server queues every record in the filter, including records the client already has. The #364 legacy pull test pins this: 11 records transferred, where 1 was already on the client. - Data Integrity / Migration Impact: None known. Each failure happens before the server applies any data, and the transfer session is left open on both sides.
- Backward Compatibility: Any fix must keep the request flow with servers before 0.6.0 unchanged. The #364 characterization tests cover that flow.
- Unconfirmed: Whether any Kolibri deployment sets
MORANGO_DISALLOW_ASYNC_OPERATIONS.
Metadata
Severity / Priority: P2 (Medium: the sync fails, but the workaround is to leave async operations allowed)
Area: DEV: backend
AI Usage
Drafted with Claude (Claude Code) from failures found while writing the #364 characterization tests. The tracebacks and request lists come from real test runs. The code references were checked against the branch.
- Ngôn ngữ chính
- Python
- Star
- 15
- Fork
- 27
- Merge trung bình
- 6 ngày 44 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của learningequality/morango
-
Document disk export and deprecations in the changelogCó thể làm lại được @ArpitaSamanta10 đã nhận 14 ngày trước và không có pull request nào đang mở. Đang mởDEV: dev-ops DEV: distributions DOCS: developer
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/morango#387 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend DEV: dev-ops TAG: unit tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
learningequality/morango#385 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 54/100
learningequality/morango#425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 1/100
learningequality/morango#424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies DEV: dev-ops TAG: dependencies
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
learningequality/morango#399 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của learningequality/morango
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Có thể đã có người làm @cestercian đã nhận hôm nay. Đang mởcomp/cli P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#162259 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AOSSIE-Org/PictoPy#1802 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
community-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
pytorch/pytorch#207247 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày