Bug - Waiting for Info exiting Ronin while in multi-adventure sequence causes Debug/stack trace

Veracity

Developer
Your session log tells me that you took the non-elemental-trap route through the Hedge Maze that took you through the topiary gopher and topiary duck.
You end up in room 9 - Mazel Tov! - having collected a topiary nugget from the room before.
In that (final) room, you need to take the single offered choice to exit the Hedge Maze.

Looking in the DEBUG log, I see this:

Code:
	at net.sourceforge.kolmafia.session.SorceressLairManager.hedgeMazeScript(SorceressLairManager.java:1165)
	at net.sourceforge.kolmafia.session.SorceressLairManager.hedgeMazeGopherDuckScript(SorceressLairManager.java:847)
which is:

Code:
		while ( status.equals( "step4" ) )
		{
			GenericRequest request = new PlaceRequest( "nstower", "ns_03_hedgemaze" );
			RequestThread.postRequest( request );
In other words, you stil have not cleared the maze; you need to take the final choice:

Code:
		case 1013:	// Mazel Tov!
			// Then you both giggle and head through the exit at the same time.
			QuestDatabase.setQuestProgress( Quest.FINAL, "step5" );
			break;
The rest of the stack trace confuses me.

You submit the PlaceRequest.
KoL redirects (expected, since you have one more choice to take)
GenericRequest call ChoiceManager.handleRedirectedChoiceAdventure
That method submits the request to choice.php
... and KoL redirects to fight.php. Presumably, this is the topary duck.
We automate the fight
When we are done, it wants to "recalculate adjustments" which, since you are out of Ronin, and since you want to retrieve from your Clan Stash, refreshes the stash.
That redirects, since you are stil in a choice.
It automates the choice chain all the way to Mazel Tov!
... which calls api.php, ultimately doing this:

Code:
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList.sort(ArrayList.java:1723)
	at java.base/java.util.Collections.sort(Collections.java:179)
	at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:163)
	at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:155)
	at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.resetConcoctionStatGains(ConcoctionDatabase.java:1576)
	at net.sourceforge.kolmafia.KoLCharacter.setClassName(KoLCharacter.java:1643)
	at net.sourceforge.kolmafia.KoLCharacter.setClassType(KoLCharacter.java:1627)
	at net.sourceforge.kolmafia.request.CharPaneRequest.parseStatus(CharPaneRequest.java:1762)
	at net.sourceforge.kolmafia.request.ApiRequest.parseStatus(ApiRequest.java:420)
The exception happens while sorting the "usables" list.

I don't understand what else is actively iterating over the usables list while we try to sort it.
But I especially don't understand why it tried to retrieve the stash after the topiary duck, since you were still in a choice/fight/choice chain.
I would have hoped the the fight would return right to SorceressLairManager.hedgeMazeScript(), which would submit place.php, redirect to a choice, and automate the next sequence of choices. All the way to the end, in particular.

This confuses me because I could swear I fixed Stash Retrieval as a result of another bug report (from you?) to not even try to retrieve the stash if you are in a fight/choice chain.

Code:
	public static final LockableListModel<AdventureResult> getStash()
	{
		if ( !ClanManager.isStashRetrieved() && !GenericRequest.abortIfInFightOrChoice( true ) )
		{
			RequestThread.postRequest( new ClanStashRequest() );
		}
		return ClanManager.stashContents;
	}
Yup.

Pondering.
 

Veracity

Developer
I wonder. When you defeat a topiary critter, there will be a link to continue in the hedge maze.
If it goes right to the next choice, it will be choice.php and we will be in a "choice follows fight" situation.
But what if it is to "place.php?whichplace=nstower&action=ns_03_hedgemaze"?
In other words, a "place follows fight" situation. We do not support that.

It has been years since I fought anything in the Hedge Maze; once I got my last factoid for the topiary critters, it's been all traps all the way.

Next time I ascend - it may be next challenge path, unless the next PVP season interests me - I'll get a log of traversing the hedge maze and fighting a couple of topiary critters.

Until then, if you happen to be able to do this, please turn on DEBUG logging before using the script, turn it off afterwards, and post the log here, please.
 

MCroft

Developer
This confuses me because I could swear I fixed Stash Retrieval as a result of another bug report (from you?) to not even try to retrieve the stash if you are in a fight/choice chain.

Code:
	public static final LockableListModel<AdventureResult> getStash()
	{
		if ( !ClanManager.isStashRetrieved() && !GenericRequest.abortIfInFightOrChoice( true ) )
		{
			RequestThread.postRequest( new ClanStashRequest() );
		}
		return ClanManager.stashContents;
	}
Yup.

Yep, I reported this last month for opening the Hidden City and you fixed it in r20380 (that fix above?). The link in my report is to that thread. This was your comment on the fix:
Revision 20380 fixes a bunch of this.

- do not attempt to retrieve stash if you are in a fight or choice.
- any TransferItemRequest will not submit a request if you are in a fight or choice, Instead, it will throw an appropriate error
- KoLCharacter.setFamiliar() will do nothing if the familiar already your current familiar.

It sounds like
1: I should buy a lottery ticket, because in a 6 week period, I've exited Ronin 6 times, 2 of which were during multi-round actions. If I exit ronin while fighting Ed, I'll have a trifecta.
2: I might want to turn off "retrieve from clan stash", but that won't help mafia in general, becuase someone somewhere will will the multi-round action lottery

ETA: I will turn on debugging before my next Hedge Maze, but since I just ascended, it'll be a week or so. I am not an Ascension Speed Expert.
 
Last edited:

Veracity

Developer
That stack trace showed me that we reset concoction stat games every time we parse status from api.php and see your chara cter class. That is a costly operation - not least because it sorts the usables list, which was the direct cause of the exception you reported (although the root cause remains unknown). Revision 20482 only does that (and similar things) if your class has changed since we last looked.

I still want to resolve the supposed "place follows fight" issue, but it's an efficiency improvement regardless - and will prevent this exact situation from recurring, even before I can see a DEBUG log and fix the other issue.
 

MCroft

Developer
Debug log of my main, started just before I chose to the Hedge Maze (Gopher & Duck) from the Quests menu, ending after I go to the tower door.
 

Attachments

  • DEBUG_20201111.txt
    343.1 KB · Views: 0
Top