Skip to content

Observatory: Clear removed outbounds#5876

Merged
RPRX merged 2 commits intoXTLS:mainfrom
Alaxay8:fix/observatory-prune-stale-status
Apr 6, 2026
Merged

Observatory: Clear removed outbounds#5876
RPRX merged 2 commits intoXTLS:mainfrom
Alaxay8:fix/observatory-prune-stale-status

Conversation

@Alaxay8
Copy link
Copy Markdown
Contributor

@Alaxay8 Alaxay8 commented Mar 31, 2026

Summary

Prune stale observatory statuses when an outbound is no longer returned by the handler selector.

Problem

observatory.Observer.updateStatus() didn't remove entries for outbounds that had already been removed. As a result, GetObservation() could keep returning stale OutboundStatus items after outbound removal.

Changes

  • prune statuses whose outbound tags are no longer active
  • add tests covering removed outbound pruning
  • preserve status fields for remaining active outbounds
  • clear all statuses when no active outbounds remain

Validation

  • go test ./app/observatory ./app/observatory/burst
  • manual runtime check with HandlerService and ObservatoryService
  • removed an outbound via API
  • confirmed the removed tag no longer appears in GetOutboundStatus

@RPRX
Copy link
Copy Markdown
Member

RPRX commented Apr 4, 2026

@Fangliding

Refactor observer to clear removed outbounds instead of updating status. Introduced slices package for improved outbound checking.
@Fangliding
Copy link
Copy Markdown
Member

重新弄了一下这样应该没问题了 很小的改动

@RPRX RPRX changed the title Fix stale observatory status after outbound removal Observatory: Clear removed outbounds Apr 6, 2026
@RPRX RPRX merged commit 8895bc6 into XTLS:main Apr 6, 2026
@RPRX
Copy link
Copy Markdown
Member

RPRX commented Apr 6, 2026

@Fangliding 修一下 test 然后 force-push 一下吧

Fangliding added a commit that referenced this pull request Apr 6, 2026
* fix: prune stale observatory status

* More readable

Refactor observer to clear removed outbounds instead of updating status. Introduced slices package for improved outbound checking.

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
@Fangliding
Copy link
Copy Markdown
Member

aiya

@RPRX
Copy link
Copy Markdown
Member

RPRX commented Apr 7, 2026

@Fangliding test 还是没修好,得了你 force-push 两个 commits 吧

Fangliding added a commit that referenced this pull request Apr 7, 2026
* fix: prune stale observatory status

* More readable

Refactor observer to clear removed outbounds instead of updating status. Introduced slices package for improved outbound checking.

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
@Fangliding
Copy link
Copy Markdown
Member

忘记add了 这次该好了

Exclude0122 pushed a commit to Exclude0122/Xray-core that referenced this pull request Apr 19, 2026
* fix: prune stale observatory status

* More readable

Refactor observer to clear removed outbounds instead of updating status. Introduced slices package for improved outbound checking.

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
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