Bug stash refreshing 1000+ times

Veracity

Developer
Staff member
Shouldn't. The only properties which are NOT "user editable" are:

saveState*
externalEditor
preferredWebBrowser

You cannot use the "set" CLI command to set those. Prior to revision 19074, you COULD use set_property() to set them, but you can't do that anymore.
 

AlbinoRhino

Active member
Ah. Thanks. I wasn't sure what that did...though it did occur to me that I believe set_property() uses the 'set' command (I think) but the reverse isn't true and I did manage to trigger this with the 'set' command, which means set_property() probably wasn't involved.

In any event, as long as I never set autoSatisfyWithStash to true, it seems everything works perfectly. Which is fine, because I always disabled it away from my home clan anyway. And in my home clan, I don't think I hardly ever use the stash (though mafia maybe used it once in a while when creating or whatever).
 

Veracity

Developer
Staff member
set_property() uses an internal version of the "set" command which bypasses some of the overhead (the actual command line parsing, for example) - including, as it turns out, the isUserEditable check. That was unintentional. I fixed it.

I have never run with autoSatisfyWithStash. I depend on resources I have gathered myself - or the mall.

I have not studied your report here, but something seems broken. We are supposed to refresh the stash when you switch clans. The clan stash IS volatile - clannies can change it out from under you. So, perhaps it refreshes the stash every time it wants to acquire something?

I'll investigate, by and by, but running with that setting turned off seems like a good idea to me, regardless.
 

AlbinoRhino

Active member
The only other people in my clan were my brother and a friend of mine. Both he and she quit playing long ago. So it's just me really. But, the good part is, they gave me their passwords...so now, whenever I have class-specific code I need to test, I always have a character available who is the correct class. Otherwise, I only really play AlbinoRhino anymore. I used to play him as hardcore and MeatBall as softcore, since I liked playing both ways. But, after the changes to the Karma system, MeatBall kind of fell to the wayside as well.

As to the stash problems, I can't really think of what it might be trying to acquire. Especially away from my home clan, when I always had autoSatisfyWithStash disabled anyway.
 

AlbinoRhino

Active member
I actually saw that during my own research but dismissed it as being too long ago. I've only noticed this, guessing, at most, a week ago? Maybe less even. I certainly would have noticed it before then if it had been happening since August. It's hard to miss.
 

heeheehee

Developer
Staff member
I'm noticing that your debug log contains a bunch of queued-up ClanStashRequests, and also a significant gap in time between when you look at your public profile, and when the first clan stash request actually goes through:

Field: Date = [Mon, 21 Jan 2019 23:48:43 GMT]

Field: Date = [Mon, 21 Jan 2019 23:49:14 GMT]

(roughly half a minute)

I admittedly don't fully understand Mafia's RequestThread logic, but I wonder if something like RefreshConcoctions (as Darzil suggests) is, by invoking getStash() a bunch of times, spawning a bunch of requests for new ClanStashRequest (which would have in fact been added by that revision).

From my investigation, it looks like ClanManager.isStashRetrieved() is only set to return true once we parse the clan_stash response. Perhaps we should add some sort of mutex / other locking to that structure so we don't try to refresh the clan stash while a refresh is ongoing?
 

heeheehee

Developer
Staff member
My point is that there's a solid 30s between Mafia looking at your profile, and the first clan stash request going through. Unless you have a 30s wait baked into one of your scripts, that seems like a long time.
 

heeheehee

Developer
Staff member
No, refresh session just calls a bunch of internal functions.

It turns out that fetching your own profile is something that ClanManager does, as part of determining your current clan name and clan id.

I've stared at the code a little longer, and I don't think that refreshing concoctions is at fault. ClanManager.getStash() is only called maybe twice per concoctions refresh.

Is there any chance you're running some sort of maximize command in your login script while autoSatisfyWithStash is true? That does invoke InventoryManager.getAccessibleCount() for each CheckedItem, which in turn has the potential to invoke ClanManager.getStash() if the appropriate preference is set.
 

AlbinoRhino

Active member
Yes indeed. My login script uses maximize to dump rollover gear and dress in +item gear. In fact, my script(s) use maximize frequently to change gear depending on the task at hand. Although, my login code, in particular, only does that once I think.
 

AlbinoRhino

Active member
Hmmm....I just noticed something that I suspect may be related to this issue. It appears my home clan stash is completely empty. (I suspect that this may have happened when I was messing with my inventory sorting code a while back.)

Because the stash is empty, the dropdown for withdrawing items doesn't appear on the page at all. Only the "add items" form appears.

This seems unusual enough that I thought it might have some bearing on this.

I've continued to experience no problems since disabling autoSatisfyWithStash.

I don't need to use the stash for anything so I am reluctant to re-enable it and test, but I am assuming the behavior is still occuring when that prop is enabled.

Since this is only affecting me, it's probably not worth any effort. Though, for possible future reports, I guess the next logical test would be to confirm that the behavior is still happening and then add some items to the stash, and see if it stops?


 

heeheehee

Developer
Staff member
Right, we never actually fixed the issue.

r19173 adds a synchronization block to getStash() to (hopefully) make sure that we only issue one stash refresh at a time.

I'd appreciate it if you could confirm that the problem still exists with r19172 but not with r19173. I was unable to reproduce in both cases :(
 

AlbinoRhino

Active member
with r19172 - logged in, enabled autoSatisfyWithStash, clicked "Refresh Session", got tons of "Refreshing stash contents..." lines followed by tons of "Stash list retrieved." lines. So that's confirmed. I will update and re-build and post again.
 

heeheehee

Developer
Staff member
I'm not convinced that r19173 does the right thing. I'll have to look some more at how RequestThread does its stuff.
 

AlbinoRhino

Active member
with r19173 - same procedure, except autoSatisfyWithStash was already set true from previous test. Login, "Refresh session" --> tons of stash requests.
 

AlbinoRhino

Active member
It's funny that the stash request that is made at login seems to work fine, regardless of the autoSatisfy setting.
 

AlbinoRhino

Active member
r19173 - set ASWS (autoSatisfyWithStash) to false and logged out, closed mafia (after previous test). Logged in fine. "Refresh session" = worked fine. Typed "set autoSatisfyWithStash = true" in the cli, and just changing the prop triggered the behavior. Waited several minutes for all of the requests to complete (the character panel will turn from gray to green when it eventually finishes.) Added a single "Drink Me" potion to the stash (via Mafia clan manager frame). Which worked fine. Clicked "Refresh session" again. Triggered the buggy behavior (which seems to shoot down my latest theory). Waited several minutes for completion (green char pane). Typed "set autoSatisfyWithStash = false". Clicked "Refresh session". Worked fine. Took "Drink Me" from stash (leaving it empty again). Clicked "Refreshed Session". Worked fine.
 

AlbinoRhino

Active member
Just looked through all of my local tweaks again and can't see anything related to this. It all appears relatively minor to me and I'm pretty sure it all pre-dates this behavior. However, I will post it here if anyone cares to see if I've screwed myself up somehow.
 

Attachments

  • 20190413_0101_mafia_all_.patch
    19 KB · Views: 13
Top