ISSUE DESCRIPTION Removing a registered or subscribed service leaves stale local…
- User
ISSUE DESCRIPTION
Removing a registered or subscribed service leaves stale local metadata
After a successful unregister or unsubscribe operation, the corresponding provider or consumer URL must no longer participate in local metadata, service matching, or revision calculation. Removing one URL must preserve unrelated registrations. If the remote operation fails, local metadata must not be removed as though the operation succeeded.
Interface
Type: Function Name: RemoveService Path: metadata/metadata.go Input: registryId string, url *common.URL Output: (no return value) Description: Removes a provider service URL from the local metadata for the given registry. Use this during unregister flows to keep the in-memory application-level metadata consistent with the actual exported services.
Type: Function Name: RemoveSubscribeURL Path: metadata/metadata.go Input: registryId string, url *common.URL Output: (no return value) Description: Removes a subscribed service URL from the local metadata for the given registry. Use this during unsubscribe flows to ensure stale subscribed URLs are cleaned from the application-level metadata.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /dubbo-go, current file: none) bash-$
- Assistant
I'll start by exploring the repository structure and the metadata package to understand how services are currently registered and tracked.
- Assistant
Let me read the main metadata file and search for related add/remove patterns.
- Assistant
I'll inspect MetadataInfo and related add/remove methods next.
- Assistant
rg is not available, let me use grep instead.
- Assistant
The methods exist on MetadataInfo already. Next I'll check callers and the full Remove implementations.
- Assistant
I'll inspect registry unregister/unsubscribe paths that call AddService.
- Assistant
I'll read the full UnRegister/UnSubscribe implementations and revision-related logic.
- Assistant
I'll check revision handling and the existing metadata tests.
- Assistant
I'll look for sett revision calculation and similar Java-style remove patterns in the codebase.
- Assistant
I'll check URL equality helpers and how unregister passes URLs.
- Assistant
I'll contrast base_registry UnRegister with metadata remove semantics.
- Assistant
I'll open RegisterService and the beginning of the registry file.
- Assistant
Implementing the two package-level remove helpers and wiring them into successful unregister/unsubscribe paths.
- Assistant
The edit landed in the wrong file — I'll undo that and apply it to
metadata/metadata.go. - Assistant
Good, metadata.go is open. Now let me edit it properly.
- Assistant
I'll wire cleanup into unregister/unsubscribe only after the remote operation succeeds.
- Assistant
Updating UnRegister and UnSubscribe to clean local metadata only when the remote step succeeds.
- Assistant
I'll harden
RemoveServiceso ServiceInfo stays while other URLs with the same match key remain, and improve URL matching beyond pointer equality. - Assistant
I'll check whether MetadataInfo recalculates its revision and scan for other call sites that may need cleanup.
- Assistant
I'll find who calls UnRegister and UnSubscribe so the cleanup path matches real usage.
- Assistant
I'll inspect how the registry protocol registers and unregisters URLs.
- Assistant
I'll check the Onder existing UnRegister/UnSubscribe tests for assumptions I might break.
- Assistant
I'll improve URL removal matching, then verify with a small temp test.
- Assistant
I'll run a temporary script and existing package tests to verify the behavior.
- Assistant
Need to set GOPATH or GOMODCACHE
- Assistant
All package tests passed. I'll run the temporary verification script next.
- Assistant
I'll verify the final diff and clean up the temporary files.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →