How to clean state when a script freezes?

PerilousApricot

New member
Hello,

I've searched and searched and I just can't find how to get this to work:

Occasionally, I'll be running a script, and it'll just get "stuck". I hit escape, then try to rerun the script, but instead of it running, it just queues up another script in the queue, but the "running" script doesn't go away. Is there a way to blow away the currently running script + the queue without quitting and restarting mafia?

Thanks,
Andrew
 

PerilousApricot

New member
For instance, I just restarted and tried to run the EatDrink script again, and my CLI is paused at

Pass 3: spleen.
spleen: At 0, consuming to 15 with 209798 meat.
Searching for "Breathetastic™ Premium Canned Air"...
 

fronobulax

Developer
Staff member
You might also consider just being patient. While lag this Crimbo is not as bad as it has been in some years, I am finding several things take longer than expected, including EatDrink. Indeed, if EatDrink (since you selected it as an example) is really freezing then I can think of at least two people who would work to eliminate the freeze if it can be reproduced and gets reported in the EatDrink thread.
 

Theraze

Active member
In this case, it's probably not actually an ED freeze but mafia hung up on something. As lost says, graygui force might solve it, or you might need to fully restart mafia... the Java session itself has to close, logging out is not enough.

I've had it happen with, well, probably most of the scripts I've used at this point. Sooner or later you end up with that. And you either patiently wait for mafia to finish chugging through everything in its brain or you force matters and quit fully.

Powertip. If you've hit the abort button (or Escape key) and it hasn't finished aborting, when it DOES finish aborting, the queue will get cleared then. And everything you told it to do in the meantime will disappear. So don't start planning your next big queue of directions yet.
 

PerilousApricot

New member
Hey everyone,

Thanks for the suggestions. I managed to hit the same thing with EatDrink again (which, from what I see, is the canonical script to do that). I tried the graygui force suggestion above (after waiting for ~5mins when it hung) and got this:

Search complete.
Searching for "insanely spicy enchanted bean burrito"...
Search complete.
Searching for "goat cheese"... <This is where it hung>
KoLmafia declares world peace.

> CURRENT: call scripts/EatDrink.ash
> QUEUED 1: call scripts/Harvest.ash

KoLmafia declares world peace.

> CURRENT: call scripts/EatDrink.ash
> QUEUED 1: call scripts/Harvest.ash
> QUEUED 2: call scripts/EatDrink.ash

4 request sequences will be ignored.
Unable to determine KoLmafia process id.

> CURRENT: call scripts/EatDrink.ash
> QUEUED 1: call scripts/Harvest.ash
> QUEUED 2: call scripts/EatDrink.ash
> QUEUED 3: call scripts/EatDrink.ash

But then I still can't get kolmafia to do anything. The relay browser still works, which makes me think that java itself isn't hung. Am I missing something?

Thanks!
 

roippi

Developer
Greygui only works if you have a JDK installed, IIRC.

I'd hazard a guess that you're on wireless or some other less-than-reliable Internet. What is happening is that requests are hanging - you notice it with eatdrink because that script makes a lot of requests.
 

PerilousApricot

New member
I .. should have a JDK involved since I do some maven work, but how OSX works with JDKs/JREs is black magic to me.

I'm on a (pretty) stable cable connection, I work from home over SSH, and I rarely have any sort of latency typing into windows and almost never have my connections just drop. It's weird though there's not a timeout option (I checked the one in the login window and it doesn't seem to do anything..)

thanks!
 

lostcalpolydude

Developer
Staff member
Greygui only works if you have a JDK installed, IIRC.

I think only the part that prints out information depends on a JDK (the part you get just from "graygui"). The extra part from adding "force" doesn't depend on a JDK, at least that's how it looked when I read through that code a while back.
 

PerilousApricot

New member
Does the "forcibly retry laggy requests" tick box not work? I'd assume in the background it puts a timer and a retry loop around whatever HTTP wrapper's being used, but my client got stuck again, and I've been waiting for about 5 minutes and nothing's happened.

Thanks!
 

Veracity

Developer
Staff member
Perhaps you mean "forcibly time-out laggy requests". I don't see anything about a "retry" there. Given that, your "assumption" about the implementation is a bit off; it simply uses some sort of socket timeout on HTTP requests.

I never do that, since I think it's a bad idea. I want TCP to keep retrying until it either completes or resets.

In any case, I don't know why you are stuck if you supposedly have time outs enabled.
 

slyz

Developer
You can find everything in the session logs, but session results really are results from the current session only.
 
Top