Skip to main content

Advertisement lifetime and expiretime ?

2 replies [Last post]
burnzipi
Offline
Joined: 2006-05-19
Points: 0

Is there a mechanism that refresh the advertisement lifetime and expiretime?

I'm trying to make my custom advertisements obsolete along with the time pass, by setting low life time and expire time. The first peer published the advertisements and also set low lifetime expiretime value, the second peer "getRemoteAdvertisements(...)". It worked fine that it can find the published adv, but something should not be happened ...

The advertisements did not disappear after the lifetime or expiretime passed. So I checked the lifetime and expiretime using "disco.getAdvLifeTime(adv)" and "disco.getAdvExpireTime(adv)" and periodically observed these values every 1 second.
I've found that they are "SOMETIMES" wrong value. I published the advs with lifetime=5 min and expiretime=1 min,but the getAdvLifeTime and getExpireTime both returned around 2 minutes (119XXX ms). It was decreasing every second but it became 119xxx ms again every around 10 sec. What happen to this?
Another thing that i can see is that when i shutdown the first peer (the publish peer), the getAdvLifeTime and getExpireTime returned decreasing value until it is disappear (removed from cache), that is what I want.

I emphasize the word "SOMETIMES" because it does not go wrong like this every time, but I cannot specify when (because I don't know the actually cause of this yet) . It sometimes work fine as I want, even rarely :-(

Any suggestions?
Thanks in advance

Burnz

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thenetworker
Offline
Joined: 2003-06-13
Points: 0

Be happy. The discovery mechanism is quite straightforward. You may like to read the previous messages I posted on the mailing list.

Anyway, the only reason why you saw the "2 minutes" is that the peer actually cached the adv that has 2 minutes lifetime left. Did you expect to see 5 minutes initially in your testing? Well, you will have to make sure there are 5 minutes left when the adv is discovered and cached.

By the way, there is a technique that guarantees 100% success of troubleshooting the discovery related problems. There is a dump method to dump the cache. Really, whatever you see there in the cache is what you get. The dumping technique applies to both rendezvous and edge peers.

burnzipi
Offline
Joined: 2006-05-19
Points: 0

Thank you for the answer

I've an updated troubleshooting of my work. I'm not sure this is exactly the cause of the problem. However , it worked fine.
At the first time I override the method getID() of the advertisement like this:

public ID getID() {
return null;
}

This because I didn't know how to generate it. I copied this from ContentAdvertisement :)

After the post I tried to change the method to this :

public ID getID() {
return ID.nullID;
}

The results seem to be better. The advertisements eventually disappear from the cache (not be starved in the cache), although some of them does not get the right initial lifetime and expiretime (greater of equal). It works pretty good now :D

However I will check your post on the mailing list later
Thanks again

Burnz