Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2014, 03:53 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default Pet losing some - not all - his gear

Had the same pet for at least a week. He has 7 pieces of rawhide armor. Every couple of days, the bp and legs disaappear. Anyone know where in the code this stuff gets updated? I look at the table and it has what I expect.. At some point, no idea when, he loses the bp and legs (not in table anymre). Really weird, Maybe an issue when loggin in and loading pet?

[ I see where it gets loaded and saved - that code looks fine. Will instrument it, but don't expect the problem to be there. ]
Reply With Quote
  #2  
Old 07-18-2014, 08:35 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Usually, a code problem like that will manifest itself every time.

You might try looking at all of your logs (emu server, mysql, etc...) to see if you are having write issues. A write failure would case items to 'randomly' disappear.


I am working through inventory code atm..so, I'll keep an eye out for anything that might be wonky.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #3  
Old 07-18-2014, 08:38 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

No rent items? Nevermind just read where you said it was rawhide.
Reply With Quote
  #4  
Old 07-18-2014, 09:30 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

No rent typically disappear after 30 minutes offline..I don't even know if pets check for that.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #5  
Old 07-18-2014, 09:44 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Quote:
Originally Posted by Uleat View Post
No rent typically disappear after 30 minutes offline..I don't even know if pets check for that.
I know, I missed that when I read his post.
Reply With Quote
  #6  
Old 07-22-2014, 09:39 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

From further testing, it looks like the database is fine after the items are lost in game. The db only gets messed up after you log out of the client, and the corrupted pet inventory gets written back out. So, the loss of items seems to be on zoning, and in memory.

I'm going to focus on that today and see what I can find.
Reply With Quote
  #7  
Old 07-22-2014, 10:05 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Gave pet 12 items. Logged out to update db.

Logged back in and then zoned 9 times. On the 9th time only the 1st 5 items survived when I did a #showstats. The exact 1st 5 items, so the list got truncated. I'm guessing a race condition that didn't let the list get filled in, or perhaps somehow that process got interrupted?

This narrows the repeat process to logging in and zoning alot. I was the only one on the server at the time as well.
Reply With Quote
  #8  
Old 07-22-2014, 10:11 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

I want to say I experienced this bug myself when I was somewhat actively running Akka's Funhouse.

It is probably an initialization issue when entering the zone.
Reply With Quote
  #9  
Old 07-22-2014, 11:29 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Looking for some feedback on what I am seeing.

I don't see where we're corrupting yet, but I find this odd.

Instrumentation:

- I have log messages in ~NPC and in the spot where the pet gets his gear restored.

Steps:

- Fresh server restart
- Login with existing pet to zone 1.
- I see the pet gear restore loop run fine.
- #zone to zone 2
- I see the pet gear restore loop run fine.
- #zone to zone 1 again.
- The process for zone1 hits the ~NPC code for the pet
- I see the pet gear restore fine after this.

Isn't it odd that the ~NPC code for the pet runs when I reenter the original zone and not when I leave one?
Reply With Quote
  #10  
Old 07-22-2014, 01:48 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

I think I have found the issue... information as soon as I verify the fix....
Reply With Quote
  #11  
Old 07-22-2014, 09:14 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I've seen a few crash dumps involving pets..I wonder if this is related...
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #12  
Old 07-22-2014, 10:18 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Ok...

I added a named semaphore and created it in eqlaunch before anything else.

Then I use it to access the pet inventory in the functions in zonedb.cpp.

It seems to me this is:

1) a bigger issue - since the zone I am leaving doesn't other work in Save() before the zone I land in starts accessing it..

or

2) Somehow another mechanism was meant to handle this and isn't for pet inventory.

I can show, so far, that without my fix, the zone I land in can read the content of the character_pet_inventory table before the zone I am leaving has it completely updated... thus the problem.

This is all on my Linux server.

I can post the named semaphore fix, but I'm not happy with it and I'm hoping someone more knowledgeable with how the old zone and new zone get ordered might step in and slap me up some
Reply With Quote
  #13  
Old 07-23-2014, 01:16 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

My solution has evolved to a named semaphore in the client class. This semaphore is named after the character_id for the client. It is created on successful arrival in a zone (if you're coming from another zone, the CREAT ends up opening the one you left from (if its in use). There can, of course be multiple semaphores going on at once, for various characters, but they will clean themselves up on logout.

It's used when you save and read pet information.

It works, and I leave no semaphores around on exit.

I still feel that someone with a better idea of how db coordination is done between zones on zoning might have a more straightforward fix - or maybe tweak of existing mechanism.

Should I post about it on development? My fix works, but I'd think a patch more in tune with the original thought process might be better long term. I just can't see what that is..

[ edit: expanded the critical section to start when the zoning flag is set and to end at client's destructor. The new zone now has perfect pet data. I also moved my check on the new zone to before we read in character buffs - with the wrong timing - these could get scrogged as well.

With 15 items, I could make the pet bug show up alot - and now its always perfect, And no semaphore baggage, all cleaned up.]

Let me know if you guys want the patch posted. My code is older, but I think the changes are small enough you can fit them in if you want them.

Players happy - they were sick of losing pet gear occasionally. ]
Reply With Quote
  #14  
Old 07-29-2014, 09:56 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

My fix works. No more pet gear lost. You guys want it? I don't mind posting the details.
Reply With Quote
  #15  
Old 07-29-2014, 10:45 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by noudess View Post
My fix works. No more pet gear lost. You guys want it? I don't mind posting the details.
Go ahead and post a diff
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 09:35 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3