reactor / BlockHound

Java agent to detect blocking calls from non-blocking threads.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Be able to whitelist methods via annotation

normanmaurer opened this issue · comments

It would be cool (and less fragile imho) if we could use an annotation to whitelist a method. The annotation itself should be "provided" by the user of blockhound (just like you can also suppress warning for animal sniffer with an annotation). This way even if a user renames a method etc it will not break the blockhound whitelist config.

Hi @normanmaurer,

Annotations would require a full scan of loaded classes, which will significantly affect the performance of the installation, and it is important because BlockHound (ideally) should be applied on each test run. Adding 500-1000ms to it would make the tool less attractive and may lead to it being applied only when something needs to be debugged.

This way even if a user renames a method

Ideally, whitelisting should be done next to the library and not in the user's code, so that if the library changes the method name (or performs some other refactorings), it needs to change the whitelisting (and ideally observe have a test for it so that it will fail if whitelisting isn't touched during the renaming)