wyf027 opened a new pull request, #3491:
URL: https://github.com/apache/dubbo-go/pull/3491

   ### Description
   Fixes #3248
   
   This PR addresses the `exporterChangeableWrapper` lifecycle-publication race 
called out in the lifecycle-management section of the umbrella issue.
   
   `registryProtocol.Export` previously stored a wrapper in `bounds` before its 
register and subscribe URLs were initialized. Concurrent shutdown or re-export 
paths could therefore observe a partially published exporter, unregister a 
nil/wrong URL, or close an exporter whose registration was still in progress.
   
   The change:
   
   - gates `Export` and `reExport` against shutdown with a lifecycle barrier;
   - serializes publication per cache key while keeping unrelated providers 
independent;
   - locks old/new cache keys in deterministic order during re-export;
   - publishes lifecycle URLs atomically and rolls back a newly created 
exporter when registration fails;
   - makes graceful unregister and destroy idempotent for the same wrapper;
   - removes keyed locks when their last holder/waiter exits;
   - cleans configuration listeners during destroy.
   
   The timing tests cover blocked registration versus destroy, registration 
rollback, unrelated-provider progress, old/new-key re-export, same-key 
re-export, and concurrent unregister/destroy.
   
   Scope note: this is a focused fix for the wrapper publication/shutdown race. 
It does not redesign the existing one-URL-pair-per-provider multi-registry 
model. It also does not change the mixed `Registry.Subscribe` contract; strict 
subscribe readiness/cancellation requires a follow-up API design because some 
registry implementations run `Subscribe` as a long-lived loop.
   
   ### Testing
   
   - `make check-fmt`
   - `make test`
   - `go test ./registry/protocol -count=10`
   - focused lifecycle tests with `-count=20`
   - `go test -race ./registry/protocol -count=10`
   - `go vet ./registry/protocol`
   - `golangci-lint run ./registry/protocol/...`
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] Code has passed local testing
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to