[BUG] TagServiceImpl.update is not transactional yet performs recursive multi-row updates before updating the parent

Open Beginner friendly
#6,552 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java
Domain
backend, database

Research direction

Start in shenyu-admin/.../service/impl/TagServiceImpl.java at update (lines 86-92), then trace the recursive updateSubTags path at lines 156-193. Check how the multi-row updates behave when a descendant or the parent update fails; done means the whole update rolls back instead of leaving inconsistent ext values.

Written by the indexing model from the issue text.

Description

admin priority: medium type: bug

Description

update is not annotated @Transactional. It calls updateSubTags(tagDTO) which loads all tags, rebuilds the ext chain, and recursively calls tagMapper.updateByPrimaryKey(tagDO) for every descendant, then updates the parent itself. If the parent update (or any descendant update) fails, the descendants that already succeeded are left with ext values computed from the new parent while the parent row still holds the old values — a torn tree.

Location

shenyu-admin/.../service/impl/TagServiceImpl.java:86-92 (recursion at :156-193)

Impact

Sub-tree ext metadata becomes inconsistent with the parent; some children updated, parent/others not, with no rollback.

Suggested fix

Annotate update with @Transactional(rollbackFor = Exception.class).

Related existing issue(s)

#6520 is a different NPE on missing parentTagId; not a dup.

Identified during the 2026-08-02 audit; full list in docs/issue-candidates-2026-08-02.md.

Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
4d 11h
Merged PRs (30d)
85

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/shenyu

All issues in apache/shenyu

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.