You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/02 12:09:51 UTC
[I] [BUG] DataPermissionServiceImpl.onSelectorCreate/onRuleCreated event listeners are not transactional and insert per-user in a loop [shenyu]
Aias00 opened a new issue, #6550:
URL: https://github.com/apache/shenyu/issues/6550
## Description
Both `@EventListener` methods, in the namespace-scoped branch, iterate `namespaceUserRelMapper.selectListByNamespaceId(namespaceId)` and call `dataPermissionMapper.insertSelective(...)` once **per user** with no `@Transactional`. A failure on the Nth insert leaves the first N-1 users granted and the rest not. No dedup against re-delivered events or concurrent creation (duplicates can be inserted).
## Location
```
shenyu-admin/.../service/impl/DataPermissionServiceImpl.java:267 and :305
```
## Impact
Inconsistent data permissions across users in the same namespace — some users see the new selector/rule, others do not, with no rollback.
## Suggested fix
Annotate both listeners `@Transactional(rollbackFor = Exception.class)` and switch to a single batch insert with an idempotency guard (`INSERT ... ON DUPLICATE KEY` or pre-check).
## Related existing issue(s)
None
_Identified during the 2026-08-02 audit; full list in [`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] DataPermissionServiceImpl.onSelectorCreate/onRuleCreated event listeners are not transactional and insert per-user in a loop [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6550: [BUG] DataPermissionServiceImpl.onSelectorCreate/onRuleCreated event listeners are not transactional and insert per-user in a loop
URL: https://github.com/apache/shenyu/issues/6550
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] DataPermissionServiceImpl.onSelectorCreate/onRuleCreated event listeners are not transactional and insert per-user in a loop [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6550:
URL: https://github.com/apache/shenyu/issues/6550#issuecomment-5157752674
👋 Hello @yuluo-yx
A new issue has been opened by @Aias00:
- **Title**: [BUG] DataPermissionServiceImpl.onSelectorCreate/onRuleCreated event listeners are not transactional and insert per-user in a loop
- **Link**: https://github.com/apache/shenyu/issues/6550
Please review when you have time. Thank you! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org