Bug Intermittent issue with Relay Adventuring

Theraze

Active member
Not trying to be a pain in the ass. I know how hard trouble shooting someones problems when one is not physically present. I have used mafia since just a few months after I discovered the Kingdom. It makes the game so much more fun and easy to play.

I am going to keep researching this on my end and lay off the posting for a while

. Thanks again to everyone who helps keep this train running
Don't lay off the posting... just keep it on the right thread. :) I think you have a thread for your MMJ problem... further word on that should go there. Post here if your relay browser stops working in combat.
 
Last edited:

roippi

Developer
I've confused the two threads as well. The difference in my mind is that the "gray" issue is almost certainly related to CharPaneRequest.java, whereas this one I have no idea on :)
 

Veracity

Developer
Staff member
The issues are confusing/confused. Tom Sawyer gave us this stack trace:

Code:
Unexpected error, debug log printed.
class java.util.ConcurrentModificationException: null
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
	at java.util.AbstractList$Itr.next(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.addFormField(GenericRequest.java:561)
	at net.sourceforge.kolmafia.request.GenericRequest.addFormField(GenericRequest.java:576)
	at net.sourceforge.kolmafia.request.UseSkillRequest.setTarget(UseSkillRequest.java:312)
	at net.sourceforge.kolmafia.request.UseSkillRequest.useSkillLoop(UseSkillRequest.java:815)
	at net.sourceforge.kolmafia.request.UseSkillRequest.run(UseSkillRequest.java:696)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:73)
	at net.sourceforge.kolmafia.moods.MoodTrigger.execute(MoodTrigger.java:251)
	at net.sourceforge.kolmafia.moods.MoodManager.execute(MoodManager.java:570)
	at net.sourceforge.kolmafia.moods.MoodManager.execute(MoodManager.java:472)
	at net.sourceforge.kolmafia.moods.RecoveryManager.runBetweenBattleChecks(RecoveryManager.java:102)
	at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:375)
	at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:143)
	at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:120)
...which is KoLmafia executing some sort of recovery or mood between adventures in the Relay Browser and Java apparently telling it that the UseSkillRequest it was constructing was also being used elsewhere - or something. I wonder what else was happening at the time?

Alhifar gave use the identical stack trace on the dev forum and said it was a "GUI stuck in gray mode" problem.

Sure would be nice to figure this one out. Not that I have time to work on it.
 

roippi

Developer
It seems that UseSkillRequest.run() can be called by different parts of mafia (i.e. by a mood and by manually clicking an "up" arrow) at the same time.

Declaring the run method (or maybe useSkillLoop) synchronized might fix that problem. It might also negatively affect performance. I'll let hola address that.

I'm not convinced that that bug is the bug causing the intermittent relay issue discussed in the OP, but it almost certainly is resulting in some weird out-of-sync issues that have been reported here and elsewhere.
 

Dankia_Talos

New member
Ok, not sure if this is a good thread to post this in, but the OP and the first couple of posters reporting similar issues were similar to what I'm seeing, and I can even place exactly when it happened.

Last night, before I went to bed, I decided to fight the NS and didn't realize mafia had left me with a ranged weapon as a muscle class with no combat skills, so I autoattacked her until the combat timer ran out unsuccessfully. After that, I changed weapons and took her on again, forgetting to restore HP and suchlike, and got beaten up by the second form. After that, I restored my HP, checked my gear again...and then found myself unable to adventure in the chamber again.

I then logged out of mafia and did it in the vanilla game and thrashed her with amiable derring-do and panache and suchlike. Logged out of the vanilla game an hour or so later, started auto-adventuring in the castle to burn my large quantity of remaining turns, and now moods won't fire and HP restoring doesn't fire, as well as the relay browser adventuring not working. I can still tell it to autoadventure, but moods still don't fire and HP restores don't fire, and in my case, and it was a matter of restoring HP in the middle of buffing, I think. I'll go back and fetch the CLI log to post in a moment. After looking at it, it seems like that was, in fact, what happened, however, restarting Mafia did not fix the problem.

Any help in tracking this down and helping me fix it would be greatly appreciated, or, if the fix was on one of those two pages I skipped in this thread, pointing it out and making me feel stupid is just as helpful.
 
Last edited:

Tom Sawyer

Member
If it helps anyone on this I am looking very close at Holiday Weight Gain.

Mafia seems to have trouble either casting this buff or as I just noticed it says it cast it once yet I am seeing 30 turns of it being reported.

Then again I doubt this is causing the greyed out issues, or the out of synch issues.

Just brainstorming trying to pin down the out of synch
 
Last edited:

Bale

Minion
I've confused the two threads as well. The difference in my mind is that the "gray" issue is almost certainly related to CharPaneRequest.java, whereas this one I have no idea on :)


For what it is worth, I have an idea. Though I have a suspicion that this thread has become confused by discussing several related bugs. I am going to describe a specific subset of the problems discussed here.

Steps to reproduce this problem. Reliably. (At least this works for me. Lets see if it is true for others.)
  1. Set Mafia to stop automation is health is at 95% -- this is so that you can easily force an abort in combat.
  2. Get health down to 95% -- this is not hard.
  3. automate 1 adventure anywhere. Since your health is less than abort level it will promptly stop with the following message:
    You're on your own, partner.
    Click here to continue in the relay browser.
  4. This is the crucial step: Do not click the link! If you click that link, the problem will not occur.
  5. Instead of clicking that link or loading the relay browser, please continue to attempt to automate the fight. The easiest way of doing this is with ashq run_combat();
  6. Now, the middle panel will not load in a fight. It will load the middle panel if it is viewing a page other than fight.php, but not fight.php.
    Sometimes KoLmafia will be willing to load a fight (I have no idea about the inconsistency), but clicking the attack button or otherwise trying to use KoL's normal browser methods of acting in combat will fail to have an effect.
  7. Finishing the fight in the minibrowser will work, but it will not fix the problem. Sometimes it will fix the problem if I encounter the link to continue in the relay browser and click it. However that will not always work.

These symptoms suggest to me that the code with stores a combat page upon a failed combat causes trouble if that page is not allowed to be passed to the relay browser.

This problem matches some of the symptoms discussed in this thread, but it seems different from others. That's why I feel there are several similar bugs under discussion that may (or may not) have a common cause.
 
Last edited:

Winterbay

Active member
A good observation. Getting a "continue in browser" link will quite often make me use my "end fight" alias(while fight.php doesn't contain winwinwin call run_combat) after which this problem quite often comes up so that appears to be repeatable at my computer as well then, which is good I guess because that means it's reproducible on more than one system...
 

fronobulax

Developer
Staff member
Thank you. That is a good summary and I will try and reproduce tomorrow. If anyone is willing to check out my suspicions and they are comfortable with reverting a commit and then building, once they could reproduce this they might try reverting r9657, r9654, r9653 and r9652 and seeing if the problem goes away.
 

fronobulax

Developer
Staff member
Steps to reproduce this problem. Reliably. (At least this works for me. Lets see if it is true for others.)
  1. Set Mafia to stop automation is health is at 95% -- this is so that you can easily force an abort in combat.
  2. Get health down to 95% -- this is not hard.
  3. automate 1 adventure anywhere. Since your health is less than abort level it will promptly stop with the following message:
    You're on your own, partner.
    Click here to continue in the relay browser.

So I logged in made the changes, started a combat to lose HP, did so and then went to automate. Gray side pane and the Begin button was gray'd out. I switched to the gCLI to see what, if anything is happening and eventually I start seeing messages. It turns out that my Login script had not completed running before I started the combat. I waited until it finished and tried again. This time I got the message Health fell below 57. Auto-abort triggered. but no relay browser option. I unchecked the Automatically load option and tried again. No change. Shut down mafia and restarted. No difference. Bottom line is that the above instructions don't reproduce it for me with one character and that the "Automatically load 'click here to load in relay browser' in mini-browser" probably needs to be unchecked.
 

Tom Sawyer

Member
I am still seeing relay issues, maintaining mood issues. Mafia just seems to loose synch.

I have tried many many work arounds. Cleaned out java, tried updating my browser. Ran a clean folder with no moods, scripts, nothing checked.

Either my work computer is hosed or something just seems to snap within mafia and short of using the mini-browser a crutch nothing works.
 

Bale

Minion
The above comment is a good reason why having such a vauge thread title is misleading. He has an intermittent issue with relay adventuring, but that isn't the issue that we're talking about... I think.
 

Darzil

Developer
The above comment is a good reason why having such a vauge thread title is misleading. He has an intermittent issue with relay adventuring, but that isn't the issue that we're talking about... I think.

Yeah, but you try fitting "Intermittent issue with being unable to Relay Adventure in adventure.php whose other symptoms are moods, hp/mp restoration and between battle scripts not firing when autoadventuring, which can only be fixed by a complete retstart of Mafia, frequently but not reliably triggered by casting hp restore skills whilst a mood is being triggered" into the title bar!
 

Bale

Minion
That's why I'm not sure that he's in the wrong thread.

I'm not even sure that we were previously all discussing the same bug here.
 

Hyppy

New member
I wonder if the following line on the daily builds means that this may be fixed?

builds.kolmafia.us said:
r9715 | shwei | 2011-08-17 23:34:29 +0000 (Wed, 17 Aug 2011) | 1 line
Put skill use code in a synchronized block in case it's the mood management code running in multiple places during relay browser usage


Oh, and as far as this:
Bale said:
I'm not even sure that we were previously all discussing the same bug here.

I think that Darzil hit the nail on the head, at least for me. Intermittent lockups caused by restoring HP while moods are running. The bad part is that, for Relay Browser people without multiple monitors, the only workaround is to wait ~20 seconds between each and every manual fight.
 
Top