Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2008, 01:07 PM
irv0
Fire Beetle
 
Join Date: Jul 2003
Posts: 3
Default A possible linkdeath fix

Submitting this for your consideration.

A friend and I have been playing on our own eqemu server for a couple of weeks now. Unfortunately his ISP seems to suffer from occasional bouts of packet loss. At generally random but frequent intervals he would be running along, fighting or just standing around and find he could receive chat messages but not send his own, cast spells, /con mobs, etc.

A look at the logs revealed that his client seemed to be deciding to continually retransmit certain packets and/or fragments part of a larger sequence for which it apparently did not receive an acknowledgment from the server. His client continues to send the same single or sequence of packets over and over until it eventually gives up and he gets the you have been disconnected message.

The current code in EQStream.cpp logs but otherwise ignores packets received from the client that are older than the current sequence number. It seemed logical to me to have the server send an out-of-order ack to the client to make it happy:

Code:
--- EQEmu-0.7.0-1118/common/EQStream.cpp.orig   2008-06-25 16:50:09.000000000 +0000
+++ EQEmu-0.7.0-1118/common/EQStream.cpp        2008-06-25 16:50:47.000000000 +0000
@@ -178,6 +178,8 @@
                                _raw(NET__DEBUG, seq, p);
                                //kludge to see if it helps:
                                //SendAck(GetLastAckSent());
+
+                               SendOutOfOrderAck(seq);
                        } else {
                                // In case we did queue one before as well.
                                EQProtocolPacket *qp=RemoveQueue(seq);
@@ -222,6 +224,8 @@
                        } else if (check == SeqPast) {
                                _log(NET__DEBUG, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
                                _raw(NET__DEBUG, seq, p);
+
+                               SendOutOfOrderAck(seq);
                        } else {
                                // In case we did queue one before as well.
                                EQProtocolPacket *qp=RemoveQueue(seq);
This change may very well be a kludge, but it seems to be working well (for the last week or so). Even though my friend is still suffering from some packet loss here and there, he no longer goes linkdead and the game is now playable.
Reply With Quote
  #2  
Old 06-25-2008, 02:21 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I've been looking for a fix in this area, the error I was getting was from this same EQStream.cpp file:
Code:
if(CompareSequence(NextOutSeq, seq_send) == SeqFuture) {
_log(NET__ERROR, _L "Tried to write a packet beyond the end of the queue! (%d is past next out %d)" __L, seq_send, NextOutSeq);
I would get huge log files with this message and the same seq_send and NextOutSeq for every line. Somebody suggested remming out that log line and that did stop the huge log files but didn't solve the problem. I'll test your fix and see how it goes.
Reply With Quote
  #3  
Old 06-25-2008, 03:44 PM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default

I worship the ground you walk on if you managed to fix this bug...
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
  #4  
Old 06-25-2008, 06:32 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

HOLY SHIT, I AM ADDING THIS IN NOW LOL!

I knew it had to be something like that that was causing the bug. Hopefully this resolves the issue for good. This is one of the biggest issues I have had on my server during peak times. With this resolved, I know quite a few players that will be ecstatic lol!

If this actually works to resolve this bug, the entire community owes you a huge thanks lol! And this should get added into the source as soon as it is verified to work.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 06-25-2008, 07:42 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This is going into TGC with its next reboot, thank you
Reply With Quote
  #6  
Old 06-26-2008, 01:41 AM
MNWatchdog
Hill Giant
 
Join Date: Feb 2006
Posts: 179
Default

Hopefully this will fix some login and zoning issues too where niether completes reliably.

Its not as much of a issue on my cable connection, but when Im using the cities of Minneapolis WiFi network, it happens far more often.

If this does solves this issue, I can finally cancel my cable connection, saving me $30/month using the cities WiFi over cable.

I have to give them credit that the cities network works as well as it does though. Speed wise for browsing its decent. Im paying $15/mo for the 3Mb connection compared to Comcasts $45 for 6Mb.
Reply With Quote
  #7  
Old 06-26-2008, 09:24 AM
irv0
Fire Beetle
 
Join Date: Jul 2003
Posts: 3
Default

I can't promise that this fix will be the proverbial silver bullet, particularly for servers with dozens of players (versus my maximum of two), but I am fairly confident that it should at least help a little.

Typically, when the problem that I was having occurred, the debug zone log would fill with messages about duplicate OP_Packet and OP_Fragment with repeating sequence numbers (it still does, but at least now the server is taking some kind of action). The client debug log would indicate that it requested status for X and that it never came.
Reply With Quote
  #8  
Old 06-26-2008, 05:08 PM
Teknocrat
Fire Beetle
 
Join Date: Jan 2008
Posts: 2
Default

You are amazing if this fixes the issue!
Reply With Quote
  #9  
Old 07-01-2008, 06:22 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This code has been on my server for 4 days so far and not a single report of the "lag bug" since. I don't even think I have had to reboot it since I put this code in and normally I do every 2 days or so.

Looks like this one is probably good to be added to the source ASAP. Interested to hear if other servers running this have seen similar results.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #10  
Old 07-01-2008, 06:52 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I'll add it in the next few days if no one's experienced any issues by then.
Reply With Quote
  #11  
Old 07-04-2008, 05:24 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Just wanted to mention that 2 of my players that have had this bug chronically have just posted saying that they haven't seen it happen a single time since this code was added about a week ago.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #12  
Old 07-25-2008, 05:57 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This one definitely needs to be added in the next release! It is a verified fix as far as I am concerned. Still have not had a single player report this bug since I added this on my server.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #13  
Old 07-25-2008, 06:14 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

It should be in atm.
Reply With Quote
  #14  
Old 07-25-2008, 06:22 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Sorry, just saw that lol. Didn't see you already just put a release out. Going through and posting in the others I think should be in the next one.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #15  
Old 09-09-2008, 11:12 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I'm still seeing this error... Did this fix make it in? If it did, it wasn't the final solution :(

Tried to write a packet beyond the end of the queue!


This is filling up log files. I could just rem out the line in the code, but that doesn't fix whatever is wrong, only hides it. Maybe somebody can convice me that this isn't really an error?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:08 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3