Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: record service instance which is unbound and recycle later #1775

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

songzxc789
Copy link
Contributor

No description provided.

Copy link
Collaborator

@SheepSheepChen SheepSheepChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还需要添加单测

@@ -165,8 +172,21 @@ def provision(self):
).inc()

def recycle_resource(self):
if self.db_obj.service.prefer_async_delete:
self.mark_unbound()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

解绑过程需要加逻辑 而不是在回收逻辑里面
你需要先在开发者中心试一下解绑服务是由那个接口或者入口触发的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

由这个接口触发,
DELETE make_app_pattern(f"/services/{SERVICE_UUID}/$", include_envs=False),
,会触发 ModuleCleaner.delete_services(),传入 service_id。 删除module时也会解绑增强服务,也会触发ModuleCleaner.delete_services(),不传service_id。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

远程增强服务也需要有 self.db_obj.service.prefer_async_delete 类似的判断逻辑

@@ -279,6 +285,7 @@ def sync_instance_config(self):
def recycle_resource(self):
"""对于 remote service 我们默认其已经具备了回收的能力"""
if self.is_provisioned():
self.mark_unbound()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

apiserver/paasng/paasng/accessories/servicehub/urls.py Outdated Show resolved Hide resolved
apiserver/paasng/paasng/accessories/servicehub/views.py Outdated Show resolved Hide resolved
)
unbound_instance.recycle_instance()

return Response()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要添加单测

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