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

fix: file-worker任务状态更新请求无序到达导致第三方源文件偶现分发失败 #2434 #2443

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

jsonwan
Copy link
Collaborator

@jsonwan jsonwan commented Sep 13, 2023

  1. 任务状态更新支持事务与写入锁定,保证多条关联数据更新的原子性;
  2. 优化文件下载任务表索引;
  3. DAO层代码全部改用声明式事务;
  4. 删除部分未使用的冗余代码;
  5. 优化file-worker线程池配置,增加监控。

@@ -58,8 +58,7 @@ public class FileSourceServiceImpl implements FileSourceService {

@Autowired
public FileSourceServiceImpl(FileSourceTypeDAO fileSourceTypeDAO,
FileSourceDAO fileSourceDAO,
FileWorkerDAO fileWorkerDAO) {
FileSourceDAO fileSourceDAO, FileWorkerDAO fileWorkerDAO) {
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
Collaborator Author

Choose a reason for hiding this comment

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

已修改

FileWorkerDAO fileworkerDAO,
FileSourceDAO fileSourceDAO,
DispatchService dispatchService,
FileTaskDAO fileTaskDAO, FileWorkerDAO fileworkerDAO,
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
Collaborator Author

Choose a reason for hiding this comment

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

已修改

@@ -121,6 +120,7 @@ public TaskInfoDTO startFileSourceDownloadTask(String username, Long appId, Long
fileSourceId, filePathList, null);
}

@Transactional(rollbackFor = {Throwable.class})
Copy link
Collaborator

Choose a reason for hiding this comment

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

@transactional 需要value 属性指定TransactionManager(轻量化部署不指定的情况下会报错))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

@@ -240,50 +240,55 @@ private void notifyFileTaskStatusChangeListeners(FileTaskDTO fileTaskDTO, FileSo
}

@Override
@Transactional(rollbackFor = {Throwable.class})
Copy link
Collaborator

Choose a reason for hiding this comment

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

@transactional 需要value 属性指定TransactionManager(轻量化部署不指定的情况下会报错))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

@@ -51,8 +51,7 @@ public class FileSourceTaskStatusUpdater implements FileTaskStatusChangeListener

@Autowired
public FileSourceTaskStatusUpdater(FileSourceTaskDAO fileSourceTaskDAO,
FileTaskDAO fileTaskDAO,
FileSourceTaskStatusChangeListener listener) {
FileTaskDAO fileTaskDAO, FileSourceTaskStatusChangeListener listener) {
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
Collaborator Author

Choose a reason for hiding this comment

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

已修改

@wangyu096 wangyu096 merged commit 78d1542 into TencentBlueKing:3.8.x Sep 14, 2023
2 checks passed
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.

2 participants