Extra pool settings not always used?

Issue #73 on hold
JohnGypsy created an issue

I've noticed this for the past few days. Basically, on my Stats page, it just sometimes doesn't show my Zpool line. I can reload/refresh and it still just doesn't show. (It does show me as logged in.) I then go to Settings and see that it has my Zpool payout address -- so all looks good. If I then scroll to the bottom and click Save Settings (even though I changed NOTHING at all), I can go to my Stats page and it then ALWAYS shows up for the rest of that session.

If I close my browser and go back in, it will often NOT have the Zpool data again -- and I can get it back by going to settings, changing nothing, clicking save, and going back to the Stats page.

Note that if I JUST go to settings and then back to the Stats page -- it does NOT fix it. I have to click Save on the Settings page to get it to fix itself.

Just wanted to report this. Thanks!

NOTE: I'm running 1.3.1beta according to your site (which is not an option for the Version on this page).

Comments (9)

  1. James Dimitrov repo owner

    I've been testing the API for zpool, and for some reason they only reply once every 2-3 minutes. What is happening is that when you resave the settings, you are deleting the local cached data on my server, and it is repolling zpool and sometimes getting lucky.

    You can verify the zpool issue here

    http://www.zpool.ca/api/walletEx?address=YOUR_PAYOUT_ADDRESS

    When I open this, 90% of the time I get a blank page.

  2. JohnGypsy reporter

    Ok, so, if you don't get a reply from Zpool, then why aren't you showing the local cached data that you have?

    Also, this is very repeatable for me. Seems odd that I'd get lucky that often. Basically, any time of the day, I can go to the page and it won't have any Zpool data. I can refresh that several times and still no Zpool data. Then I go to Settings, click save (which empties your local cache), and then go straight to the Stats page and it ALWAYS then has the Zpool data. Every time.

    Something more seems to be going on, yes? Or am I missing something?

  3. JohnGypsy reporter

    That being said -- I went to the page just after posting that (and hadn't been there yet today), and it had Zpool data. That's the first time I think I've seen it do that (without me going to the Settings page first and re-saving) in a week! :)

  4. James Dimitrov repo owner

    So if you refresh the main page 4-5 times, does it immediately go away or does it go away after about 5 minutes? The cache is only retained for 5 minutes, so this would be a good indicator of what's happening, you can also look for the following string:

    ex: Cached Result: 2017-12-28 16:35:39 GMT (11 seconds ago)

    That will tell you if it's pulling from the cache. If you do not see that string and zpool is missing, then that means the zpool API did not respond on time and I've cached no data from zpool for the next 5 minutes. That is when resaving settings might make it "reappear"

  5. JohnGypsy reporter

    The thing is that it doesn't "go away." It isn't there to start with. I go to the stats page and it just isn't there (most of the time). I try to refresh and it isn't there. I go to Settings, Save, and go back to the Stats page -- and it IS there (every time).

    Also, I assume you aren't doing ongoing checking of Zpool unless we are looking at the page, right? You're not checking it in the background all the time, right?

    It appears what happens is this then: I go to the page and you must do a pull from Zpool -- and, for whatever reason, that fails (because it isn't on the page at all for me). I can refresh that page and it doesn't appear. I then have to do the settings thing -- which would only delete your cache, right? -- to get Zpool to appear.

    So, maybe your first request fails for some reason? Or there is some cache hit problem?

    I'll try to check it more next time it fails to appear for me. Right now, it is showing up.

  6. James Dimitrov repo owner

    The cache is stored as a long encoded and serialized string of data and all the data for all pools is stored in one string. In other words, if you don't hit the cache, the page would show nothing. The fact that you're seeing everything but zpool indicates that the cache is there and intact, but the zpool data isnt there. I think this comment is 100% accurate:

    I go to the page and you must do a pull from Zpool -- and, for whatever reason, that fails (because it isn't on the page at all for me). I can refresh that page and it doesn't appear. I then have to do the settings thing -- which would only delete your cache, right? -- to get Zpool to appear.

    The reason being when you delete the cache and retry, it is catching API results. Interestingly, Hashrefinery, Zpool and Ahashpool all use the exact same code and API, however, only Zpool sees this issue. I'm trying to trick the API now but it seems like it caches on a per-payout-address basis.

  7. Log in to comment