Skip to content

🐞 反馈问题:复杂项目多组件导出报错及导入如果包含大镜像组件和较多的组件也会导入失败 #2469

@PDMoFan

Description

@PDMoFan

请先确认以下事项:

问题描述

我们项目比较复杂,大概有30多个组件,导出全部的时候会报错,选择几个的时候不会报错,应该是SQLite并发写入问题,SQLite 是一种文件级别的单写锁(独占写锁)数据库,它不支持多进程 / 多线程同时对数据库执行写入操作(INSERT/UPDATE/DELETE 等)。

该问题是否可以稳定重现?

可重现

重现步骤

导出20+复杂依赖的组件

截图

Image

日志

以下是部分错误信息:
Traceback (most recent call last): File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute return Database.Cursor.execute(self, query, params) sqlite3.OperationalError: database is locked The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/ui/console/views/service_share.py", line 461, in post record_event = share_service.sync_event(self.user, self.response_region, team_name, events[0]) File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner return func(*args, **kwds) File "/app/ui/console/services/share_services.py", line 489, in sync_event event = self.create_publish_event(record_event, user.nick_name, event_type) File "/app/ui/console/services/share_services.py", line 478, in create_publish_event event.save() File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/models/base.py", line 741, in save force_update=force_update, update_fields=update_fields) File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/models/base.py", line 779, in save_base force_update, using, update_fields, File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/models/base.py", line 870, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/models/base.py", line 908, in _do_insert using=using, raw=raw) File "/app/ui/py_venv/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/app/ui/py_venv/lib/python3.6/site-packa

期望结果

希望复杂项目且包含大镜像组件的导出导入可以更稳定

解决方案(可选)

No response

操作系统 && Rainbond 版本

Ubuntu 20.04.6 LTS (Focal Fossa),k8s Version: v1.30.4+k3s1, Rainbond v6.4.1-release

是否愿意提交 PR 解决该问题?

  • 我愿意提交 PR 来解决该问题

Metadata

Metadata

Assignees

Labels

BugBUG Feedback

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions