[ 
https://issues.apache.org/jira/browse/METRON-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018466#comment-16018466
 ] 

ASF GitHub Bot commented on METRON-964:
---------------------------------------

Github user cestella commented on a diff in the pull request:

    https://github.com/apache/metron/pull/595#discussion_r117610139
  
    --- Diff: 
metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/JoinBolt.java
 ---
    @@ -90,11 +93,24 @@ public void prepare(Map map, TopologyContext 
topologyContext, OutputCollector ou
           }
         };
         cache = CacheBuilder.newBuilder().maximumSize(maxCacheSize)
    -            .expireAfterWrite(maxTimeRetain, TimeUnit.MINUTES)
    +            .expireAfterWrite(maxTimeRetain, 
TimeUnit.MINUTES).removalListener(new JoinRemoveListener())
                 .build(loader);
         prepare(map, topologyContext);
       }
     
    +  class JoinRemoveListener implements RemovalListener<String, Map<String, 
V>> {
    +
    +    @Override
    +    public void onRemoval(RemovalNotification<String, Map<String, V>> 
removalNotification) {
    +      if (removalNotification.getCause() == RemovalCause.SIZE) {
    +        LOG.error("Join cache reached max size limit. Increase the 
maxCacheSize setting or add more tasks to " + this.getClass().getSimpleName() + 
".");
    +      }
    +      if (removalNotification.getCause() == RemovalCause.EXPIRED) {
    +        LOG.error("Message was in the join cache too long which may be 
caused by slow enrichments/threatintels.  Increase the maxTimeRetain setting.");
    --- End diff --
    
    We should also do a `Collector.reportError()` on the message, so it pops up 
in the Storm UI.


> Add logging in JoinBolt for unexpected cache evictions
> ------------------------------------------------------
>
>                 Key: METRON-964
>                 URL: https://issues.apache.org/jira/browse/METRON-964
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Ryan Merriman
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to