Bug #3342
closed
  
Interests without explicit InterestLifetime do not trigger onTimeout callback
 
        
        Added by Mathias Gibbens almost 10 years ago.
        Updated almost 10 years ago.
        
  
  
  
  Description
  
  When creating an Interest if InterestLifetime is not explicitly set before calling Face.expressInterest() the onTimeout callback is never executed.
In Node.java the method expressInterestHelper() only sets up the timeout callback if InterestLifetime >= 0. Since InterestLifetime == -1 if not specified, the timeout callback is ignored.
I think this is a bug, and was certainly unexpected, since I had read at http://named-data.net/doc/NDN-TLV/current/interest.html#interestlifetime that the default timeout for an Interest would be 4 seconds if a timeout was not specified. I was expecting that the jndn library would call my timeout handler after 4 seconds. It seems that the correct behavior should be to use a (local) InterestLifetime of 4 seconds in expressInterestHelper() if InterestLifetime == -1.
I have attached a simple test case showing this issue.
   
 
  
  Files
  
 
  
  
    
    
    
    
       - Assignee set to Anonymous
 
    
    Thanks for the report. You have a point. I hadn't considered the case where the interest lifetime is omitted, but expressInterest is supplied an OnTimeout callback. It think I understand your solution and agree: The library will still send the interest over the wire with the interest lifetime omitted. But if expressInterest is supplied an OnTimeout callback, then it will be called after 4000 milliseconds. Is that right?
 
     
   
  
  
    
    
    
    Jeff, yes, that's what I was thinking of.
 
     
   
  
  
    
    
    
    
       - Project changed from jndn to NDN-CCL
 
    
    OK. I moved this to the NDN-CCL project since it affects all the Common Client Libraries. I'll fix it first in jNDN.
 
     
   
  
  
    
    
    
    Hi Mathias. I merged the fix in jNDN. Can you try it and tell me if it does what you expect?
 
     
   
  
  
    
    
    
    Jeff, thanks! I've tested the fix and it now works as I was expecting when an Interest doesn't explicitly set the lifetime.
 
     
   
  
  
    
    
    
    
       - Status changed from New to Closed
 
    
    Thanks for checking. I updated the other libraries too.
 
     
   
  
  
    
    
    
    
       - Has duplicate Task #3194: expressInterest should call onTimeout even for unspecified interest lifetime added
 
    
    
     
   
  
 
  
  
 
Also available in:  Atom
  PDF