[Bug]: Redeploying a changed WebSub API deletes its Kafka topics, dropping all subscribers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 56/100
調査の方向性
Start with event-gateway/gateway-runtime/internal/xdsclient/handler.go around line 213 and trace how an updated WebSub binding is removed and added again. Then read event-gateway/gateway-runtime/internal/runtime/runtime.go around line 1188, where binding removal deletes Kafka topics. Reproduce by redeploying after adding an unrelated channel; done when subscriptions and delivery on unchanged channels survive redeployment.
索引モデルが issue の本文から書いたものです。
説明
Please select the area the issue is related to
Event Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
Deploying a changed WebSub API again deletes its Kafka topics, including the internal subscription topic. Every existing subscriber is dropped without notice, and messages published after the redeploy never reach subscribers that did not unsubscribe. They only receive messages again after they subscribe again.
Any change to the deployed configuration triggers it. In the reproduction below the only change is a new, unrelated channel. A redeploy with identical content is skipped and does not lose subscribers.
Expected: subscriptions and messages on channels that did not change survive a redeploy.
Actual: all subscriptions are lost and messages published after the redeploy are not delivered.
What the event-gateway runtime logged during the redeploy:
msg="Updating binding via xDS" name=b01-ws uuid=01a1e4e1-75dd-73ff-953a-b35a35364971 kind=WebSubApi
msg="Deleted topic" topic=0d308a66f246630dc7092f19f2dfcbe7d2194b38062b88f6ab8df798c09ab55a
msg="Deleted topic" topic=d51efd60b66b664b9102ea80abdfb964eff0c145285618302412924e045361cc
msg="Dynamically removed WebSubApi binding" name=b01-ws
msg="Created topic" topic=d51efd60b66b664b9102ea80abdfb964eff0c145285618302412924e045361cc
msg="Topic metadata" topic_hash=d51efd60b66b664b9102ea80abdfb964eff0c145285618302412924e045361cc apiName=b01-ws apiVersion=v1 channelName=orders
Where it comes from in the code:
event-gateway/gateway-runtime/internal/xdsclient/handler.go:213: an updated binding is removed, then added again.event-gateway/gateway-runtime/internal/runtime/runtime.go:1188:RemoveWebSubApiBindingdeletes the binding's Kafka topics, both the data topics and the internal subscription topic, before closing the broker driver.
Related: #1872.
Steps to Reproduce
Setup: platform-api built with -tags experimental (the WebSub plugin) and an event gateway connected to it, both built from main. A webhook listener that records what it receives (event-gateway/webhook-listener, GET /received-events) is reachable from the event gateway at http://wh-listener:8090.
Deployments from platform-api to an event gateway built from
maincurrently fail because of #4288. To get past it, I cleared that gateway's stored version in platform-api's database (UPDATE gateways SET version='' WHERE handle='<event-gateway-id>'). That is a test workaround, not product behaviour.
- Create the API:
POST /api/v0.9/websub-apiswith{"id":"b01-ws","displayName":"b01-ws","version":"v1","projectId":"default","context":"/b01ws","channels":{"orders":{}}}. - Deploy it to the event gateway:
POST /api/v0.9/websub-apis/b01-ws/deploymentswith{"name":"d1","base":"current","gatewayId":"<event-gateway-id>"}. Wait until the deployment isDEPLOYED. - Subscribe the listener:
POST http://<event-gateway>:8080/b01ws/v1/hub(form-encoded) withhub.mode=subscribe&hub.topic=orders&hub.callback=http://wh-listener:8090/b01&hub.lease_seconds=3600. It returns202, and the runtime logsSubscription verified and activated. - Publish:
POST http://<event-gateway>:8080/b01ws/v1/webhook-receiver?topic=orderswith{"msg":"msg-1"}. It returns202, and the listener receives{"msg":"msg-1"}. - Add an unrelated channel:
GET /api/v0.9/websub-apis/b01-ws, add"refunds":{}tochannels, andPUTit back. It returns200. - Deploy again (same request as step 2). Wait for
DEPLOYED. The runtime logs the lines shown above. - Publish
{"msg":"msg-2"}toorders(same request as step 4). It returns202. - Check the listener (
GET /received-events) 35 seconds later. It still holds onlymsg-1;msg-2never arrives. - Subscribe again exactly as in step 3, then publish
{"msg":"msg-3"}. The listener now receivesmsg-3, so delivery itself works; only the subscription was lost.
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
- Source:
mainatf5c93849. - platform-api built from source with
-tags experimental(SQLite). - Event gateway:
event-gateway-controllerandevent-gateway-runtime0.10.0-SNAPSHOT, built from that commit; Kafkabitnamilegacy/kafka:4.0.0-debian-12-r10(SASL_SSL, fromevent-gateway/docker-compose.dev.yaml). - macOS with Rancher Desktop.
- 主要言語
- Go
- スター
- 85
- フォーク
- 137
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 247
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wso2/api-platform のほかの issue
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
wso2/api-platform#4369 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsオープンArea/Policies Aspect/Other Severity/Trivial Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
wso2/api-platform#4355 ·
メンテナーはふだん 1 日以内に返信
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wso2/api-platform#4348 ·
メンテナーはふだん 1 日以内に返信
-
Aspect/AI Aspect/API. Severity/Major
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
wso2/api-platform#4343 ·
メンテナーはふだん 1 日以内に返信
-
Area/Policies Aspect/Configuration Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
wso2/api-platform#4330 ·
メンテナーはふだん 1 日以内に返信
wso2/api-platform の issue をすべて見る
似ている issue
-
benchmark
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mozilla-ai/cq#601 ·
メンテナーはふだん 1 日以内に返信
-
documentation migration
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信