Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331819

Summary: Peers not removed when Channels are reset
Product: [Tools] TCF Reporter: Doug Schaefer <cdtdoug>
Component: CoreAssignee: Eugene Tarassov <eugene>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 0.4.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Doug Schaefer CLA 2010-12-03 18:32:57 EST
One thing I noticed in the new Target Explorer is when a channel to a discovered peer fails, e.g. when the agent is killed off, we don't get a peer removed event. Should it? Or am I using the wrong strategy (i.e. relying on peer added and remove events to determine target state).
Comment 1 Eugene Tarassov CLA 2010-12-03 18:49:55 EST
A peer is removed if no heartbeat packets received from the peer during predefined  data retention period, which is set to 1 minute.
Comment 2 Doug Schaefer CLA 2010-12-05 19:10:58 EST
Yes, I realize that. But in that time interval between the channel failure and the heartbeat there is a pretty big window when other failures will occur. That leads to pretty bad usability. That and if we assume the channel failure means the target is gone, we don't get the peerAdded event when it comes back, which is real issue at the moment.

I'm not sure what the right answer is, but we should be as accurate as possible about the target state.
Comment 3 Eugene Tarassov CLA 2010-12-06 11:11:21 EST
Removing auto-discovered peer right away when the agent is killed would be good thing to do. It can be done by catching SIGKILL in the agent.

However, a peer represents a target address - not the target itself. Peer added and removed events are not supposed to be used to track real time target state. For example, these event are send when user adds or deletes peers - regardless of the target state.
Comment 4 Eugene Tarassov CLA 2011-06-03 21:16:21 EDT
I have extended discovery protocol with additional packet type that is sent when agent is about to exit. Now peers are removed without a delay when the agent is shut down.
Comment 5 Doug Schaefer CLA 2011-06-06 10:11:44 EDT
Excellent! Thanks, Eugene.