Repository navigation
Conversation
a20307e to
1121c12
Compare
60b148b to
6510188
Compare
65efdcd to
a504612
Compare
EarthChen
left a comment
There was a problem hiding this comment.
Thanks for the substantial work. I reviewed and ran this locally before commenting.
Verified green: uv sync --locked --all-extras; pytest tests/unit (1404 passed), pytest tests/integration -m "not zookeeper and not nacos and not samples" (552 passed); ruff check/format/ty check; the 01_hello_world sample end-to-end; 2070 tests confirmed via --collect-only; CI matrix green including the ZooKeeper/Nacos integration jobs. The Triple gRPC wire implementation (5-byte framing, grpc-timeout units, trailer-only responses, grpc-status-details-bin, compression negotiation) matches the gRPC HTTP/2 spec, and the Dubbo protocol header/body layout matches Dubbo Java's documented structure.
Requesting changes on four points:
- Dependency governance. The entire wire stack hard-depends on
ngh2(HTTP/2),h11r(HTTP/1.1) andhessian2(serialization), plusngquicfor thehttp3extra — all published under the PR author's account, created between July and November 2026 (ngquictwo days before this PR), each with a single maintainer and no third-party adoption record. Established alternatives exist (h2,h11,aioquic); if the choice is a deliberate performance/design bet on Sans-I/O + native cores, please document it (ADR) with the benchmark evidence, and get explicit PMC sign-off on the dependency set. Additionally,NOTICEcarries no third-party attribution while the wheels bundlelibnghttp2,ngtcp2,nghttp3andaws-lc— the release manager will likely require aDEPENDENCIES/NOTICEupdate before any release. - Default security posture. By default a provider exposes every exported method over plain HTTP JSON (
triple.rest.enableddefaults to true) and to$invokegeneric calls over gRPC and Dubbo, with no built-in authentication (TokenFilteronly activates when atokenURL parameter is present) and TLS off. That is fine for samples but dangerous as a default. Please either invert the defaults (REST off by default, generic invoke gated) or add a prominent security note to the README/Configuration docs stating the exact unauthenticated surface a default deployment exposes. - Claims I could not reproduce from the repo. (a) "94% line and branch coverage" — the new
pyproject.tomlhas no coverage configuration and CI does not run coverage, so the number is unverifiable; please add a coverage job or drop the figure. (b) The "tests at scale" bullet (providers killed mid-call, rolling releases, registry outages) has no corresponding tests in the repository — the in-tree failure tests exercise gracefulaclose()only. Either commit the harness or scope the claim. - Migration. The public API is fully replaced (
Client/Serverare gone, Python ≥3.11, sync→async), which the PR acknowledges, but there is no migration guide; users of the previous release have only the new quick start and samples to reverse-engineer from. AMIGRATION.mdmapping old → new would substantially reduce the break's cost.
Minor: SERIALIZATION_IDS advertises fastjson2 (id 23) but no fastjson2 serialization is registered — a Dubbo Java peer sending it gets SERIALIZATION_ERROR; either implement it or remove the constant. Failover retries on UNAVAILABLE without an idempotency gate, so non-idempotent unary calls can double-execute on transport blips.
a504612 to
c621758
Compare
Replace the previous implementation with a new one built on asyncio and AnyIO, with uvloop optional, for Python 3.11 to 3.14: - the Triple protocol over HTTP/2, interoperable with gRPC, and over HTTP/3 with the http3 extra, and the Dubbo protocol with Hessian 2, both in the default installation; - one port that serves HTTP/1.1, HTTP/2 and HTTP/3, where methods also answer plain HTTP calls with JSON, at default or declared routes, with CORS and an OpenAPI document; - application-level and interface-level service discovery on ZooKeeper and Nacos, with metadata services and reports, and configuration centers; - clusters, load balancers, condition and tag routers, configurators and filters, as extension points loaded by entry points; - configuration from code, files and environment variables; - the protoc plugin that generates service stubs; - samples, from a first call to a small shop of services behind FastAPI, an agent of Pydantic AI whose tools are services, and calls to and from Dubbo Java and Dubbo Go, each with a README and run by the tests; - end-to-end benchmarks of servers on one core and on eight, beside Dubbo Java, Dubbo Go and the gRPC libraries of Python, and of a Dubbo Python consumer; - unit and integration tests on a virtual clock, CI on GitHub Actions, and release candidates for the release manager to sign. Extras add the ZooKeeper and Nacos clients, the YAML and properties configuration formats, uvloop, protoc, JSON for types other than protobuf messages, and HTTP/3.
c621758 to
b6277fb
Compare
Thanks for the review.
|
Fixes apache/dubbo#16595
Summary
This PR replaces the previous implementation with a new Python-native framework for Apache Dubbo. It runs on asyncio, with AnyIO for structured concurrency and uvloop as an option, and supports Python 3.11 to 3.14 on Linux, macOS and Windows.
It talks to Dubbo Java and Dubbo Go over both the Triple and Dubbo protocols, serves the same methods to plain HTTP clients, finds and registers services through ZooKeeper and Nacos as they do, and brings the governance of the other Dubbo languages to Python.
Highlights
grpcurl, health checks and reflection work with it. It also runs over HTTP/3 once a provider announces it.curl, browsers and web frontends call services without a stub.typing.Protocolwith type hints, calls areasync, and an application runs insideasync with, in any asyncio program. Each method of a reference has the name, signature, type annotations and docstring of its contract, so that tools that read them, such as AI agent frameworks, can take it as a function.Features
http3extra: a consumer moves a provider's calls to HTTP/3 once the provider announces it withAlt-Svcand a QUIC handshake succeeds, and falls back to HTTP/2 when it fails. HTTP/3 always runs over TLS./{interface}/{method}, withGETandPOST;dubbo.get,dubbo.postand the other verbs declare routes with path templates, anddubbo.Path,Query,Header,BodyandFormsay where each parameter comes from.google.api.httpoptions of their.protofiles, whichprotoc-gen-python-dubboreads.jsonextra.detail; CORS, and an OpenAPI 3.1 document with Swagger UI and ReDoc, when the settings enable them.typing.Protocol, or generated from.protofiles byprotoc-gen-python-dubbo.zookeeper,nacos,yaml,properties,uvloop,protoc,jsonandhttp3.Samples
samples/holds 22 samples, each with a README. The tests run them as their READMEs say. CI skips the logging, extensions, TLS, FastAPI and Pydantic AI samples, whose packages it does not install.Performance
benchmark/measures each server with the same echo service, Protobuf over Triple on HTTP/2 and Hessian 2 over Dubbo, under the same load: on Linux with a 32-core Xeon, the server pinned to its cores withtasksetand the load on the others, the median of three rounds. None of the 81 million calls failed.Calls per second, with 128-byte / 16 KiB payloads:
Tests at scale
Besides CI, the framework went through several rounds of tests at scale on Linux hosts, with providers and consumers in containers beside Dubbo Java, Dubbo Go, ZooKeeper and Nacos:
Compatibility
Testing