[Enhancement] FilterFactory duplicate-registration and unregister semantics lack tests
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with register, unRegister and get in filter/src/main/java/org/apache/rocketmq/filter/FilterFactory.java, then read the existing FilterSpiTest to see how it registers its one filter. Add cases for a duplicate type (expect IllegalArgumentException and the original instance kept), unregister returning the previous filter, get returning null afterwards, re-registration succeeding, and a second SqlFilter under SQL92 being rejected while the built-in filter still works. Run FilterSpiTest to confirm.
Written by the indexing model from the issue text.
Description
Description
FilterFactory (filter/src/main/java/org/apache/rocketmq/filter/FilterFactory.java) holds the registry of subscription filter SPIs used by the broker to compile subscriptions. Two of its guarantees have no test coverage:
- Duplicate registration is rejected, not overwritten:
registerthrowsIllegalArgumentExceptionwhen the type already exists (Filter spi type(%s) already exist!). If this guard regressed to a silent overwrite, a custom filter could silently replace the built-in SQL92 filter for every broker in the process. - Unregister/return semantics:
unRegisterreturns the removed filter (so callers can restore it) and the type becomes registerable again.
The existing FilterSpiTest only registers one filter and uses it; it never exercises duplicates, unregister/re-register, or protection of the built-in SQL92 entry.
Expected behavior
Extend FilterSpiTest: duplicate type registration throws and keeps the original instance; unregister returns the previous filter, makes get return null, and allows a fresh registration; registering a second SqlFilter (built-in SQL92 type) is rejected and leaves the built-in filter functional.
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
[Bug] mqadmin createUser/updateUser trim the ACL password, storing a secret the caller never typedPossibly taken @iloveeyjafjalla claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11446 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstPossibly taken @iloveeyjafjalla claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq#11441 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] DefaultMQPushConsumer.shutdown() never stops the pop consume service, so its non-daemon threads keep the JVM alivePossibly taken @iloveeyjafjalla claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/rocketmq#11427 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] LogicExpression three-valued truth table and short-circuit behavior lack direct testsPossibly taken @chennaji9 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11339 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] SyncStateInfo defensive-copy and epoch semantics lack direct testsPossibly taken @chennaji9 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11338 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Vakore/ZappierGames#147 ·
-
spigotmc
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Dans-Plugins/Wild-Pets#356 ·
Maintainers usually reply within 1 day
-
spigotmc
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Dans-Plugins/Medieval-Roleplay-Engine#371 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
eddyizm/tempus#1220 · 1 comment ·
Maintainers usually reply within 2 days
-
bug javascript
Difficulty 1/5 Under an hour Newbie friendliness 95/100
dbflute/dbflute-intro#690 ·
Maintainers usually reply within 1 day