Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pgoapi purge #3106

Merged
merged 15 commits into from
Aug 3, 2016
Merged

Pgoapi purge #3106

merged 15 commits into from
Aug 3, 2016

Conversation

invisiblek
Copy link
Contributor

Kill our local copy of pgoapi and instead pull in a fresh copy from tejado's repo. Fixups along the way to handle the api changes.

@medghaim
Copy link
Contributor

medghaim commented Aug 2, 2016

I know my +1 doesn't count, but thorough testing reveals all works fine and dandy. +1

@invisiblek
Copy link
Contributor Author

"medghaim commented 2 minutes from now"

wizard!

@invisiblek
Copy link
Contributor Author

People are going to need to re-run requirements.txt as well as probably purge their db (unless we want to bother with writing migration scripts)

@medghaim
Copy link
Contributor

medghaim commented Aug 2, 2016

Ew no. Delete pogom.db, re pip install -r requirements.txt

(is this from the future too?)

@invisiblek
Copy link
Contributor Author

"medghaim commented 2 minutes from now"

time traveler

@Chlodochar
Copy link
Contributor

Related #671

@medghaim
Copy link
Contributor

medghaim commented Aug 2, 2016

Yeah, invisiblek built off your earlier PR. Your commits are still up there somewhere!

@chuyskywalker
Copy link
Contributor

pgoapi INFO level logging used to be silenced, I think.

Modify runserver.py with

    logging.getLogger('pgoapi.pgoapi').setLevel(logging.WARNING)
    logging.getLogger('pgoapi.rpc_api').setLevel(logging.INFO)

@Chlodochar
Copy link
Contributor

Nice. I'm not able to test this soon, but would be very happy when this is merged! Should @tejado do a release of this commit?

@FrostTheFox
Copy link
Contributor

Definitely runs. Going to compare pokemon amounts here in a few.

@chuyskywalker
Copy link
Contributor

LGTM so far so good. I'll let it churn overnight, see if anything weird pops

@medghaim
Copy link
Contributor

medghaim commented Aug 2, 2016

Always a good sign when things run, @FrostTheFox :D

@invisiblek
Copy link
Contributor Author

Weird my hexes are off slightly now (they were perfectly aligned before). I'm using raw lat/long for them too, so they should be lined up.

@chuyskywalker
Copy link
Contributor

Sometime during the overnight run I lost one of my search_worker threads. I expect it got some uncaught exception and dumped out, but my scrollback buffer is to short to see what happened.

@invisiblek
Copy link
Contributor Author

I have 20 workers going, been running strong all night.

@chuyskywalker
Copy link
Contributor

Here we go:


2016-08-02 14:15:44,595 [ search_worker_0][      auth_ptc][    INFO] PTC Login successful
Exception in thread search_worker_0:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/src/app/pogom/search.py", line 203, in search_worker_thread
    check_login(args, account, api, position)
  File "/usr/src/app/pogom/search.py", line 239, in check_login
    while not api.login(account['auth_service'], account['username'], account['password'], position[0], position[1], position[2], False):
  File "/usr/src/app/src/pgoapi/pgoapi/pgoapi.py", line 129, in login
    response = self.get_player()
  File "/usr/src/app/src/pgoapi/pgoapi/pgoapi.py", line 84, in function
    return request.call()
  File "/usr/src/app/src/pgoapi/pgoapi/pgoapi.py", line 182, in call
    response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
  File "/usr/src/app/src/pgoapi/pgoapi/rpc_api.py", line 116, in request
    raise NotLoggedInException()
NotLoggedInException

That's causing the search_worker thread to dump out. Needs a bit of exception catching.

@chuyskywalker
Copy link
Contributor

Alright, ignore my issue, it's not really a pgoapi upgrade problem but a "I didn't handle thread exceptions well enough" problem. I'll task that in a separate PR

@chuyskywalker
Copy link
Contributor

LGTM -- I don't know if we hold off for the beehive misalignement or not though

@invisiblek
Copy link
Contributor Author

nobody else is seeing the misalignment at all? the locations i'm using literally have the exact lat or long and they're showing up misaligned =/

@medghaim any idea here? (see screenshot from above)

@chuyskywalker
Copy link
Contributor

I've fixed the reliability issues over in this a pr against this branch (that's the diff link excluding whitespace since I had to indent a lot for the fix). Should clear up and prevent any weird outliers for getting search threads lost.

@Crazy-Drew
Copy link

Crazy-Drew commented Aug 3, 2016

Can anyone give me good clear instructions on how to run more than 1 worker? simultaneously? That would be great!

I obviously am doing something wrong and can't get it working on my end.

- Handle exceptions better
 - Prevent search_workers from even fully exiting
 - High-load backoff is now backoff based instead of randomly assigned absolute
 - Logins will retry `login-retries` times before throwing an exception to
   cause the search_worker to create a new PgoAPI instance and start over
@invisiblek
Copy link
Contributor Author

This fixes the hexes being off: tejado/pgoapi#171

@invisiblek
Copy link
Contributor Author

pgoapi updated with the hex fix, latest commit pulls in that change

+111111111111111111

@DomGrieco
Copy link

@Crazy-Drew really not the place to be posting stuff like that

* Use standard logging for this and for the check of the old pogom/pgoapi
* Automatically remove pogom/pgoapi, regardless if its empty or not.
  Its not going to be useful anymore and will cause problems.
@AHAAAAAAA
Copy link
Owner

This looks ready. If anyone has any objections, speak now or forever handle issues from here on out.

@invisiblek invisiblek merged commit 59bb500 into develop Aug 3, 2016
@Chlodochar
Copy link
Contributor

Yay!

@aldarund
Copy link

aldarund commented Aug 3, 2016

@hack3rjack
Copy link

Also getting error when installing requirements.txt on line 18 for pgoapi, see gist

https://gist.github.com/hack3rjack/4a95b33dd811721d8b91389eeb44590f

@aldarund
Copy link

aldarund commented Aug 3, 2016

@hack3rjack its just a warnings that depends on your python build, all fine with it

@hack3rjack
Copy link

ok then, thanks @aldarund

log.info("Done!")

# Ensure user has updated to the new api
newpgoapiPath = os.path.join(os.path.dirname(__file__), "src/pgoapi")
Copy link
Contributor

@Yossi Yossi Aug 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not where pip installs pgoapi. In fact, there is no src/ directory.

Better to simply try importing pgoapi and catching whatever errors come up. We can also check pgoapi.__version__if that is deemed necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go ahead and use your super brain to improve it then

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will he is right, this check dont work and simply stop project from launching

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And? This is really braindead check. You basically rely that pip Will clone imto cuurent due and not clean it. This folder not even user, its just leftoff of installation . And recent pip Will delete this folder.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*due - directory
*User - used

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works awesome over here, definitely seeing way more pokemon now! I am loving this already!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest HEAD on develop.

In the future be a bit more respectful of people here. Calling anyone's code braindead is pretty fucking rude.

Copy link
Contributor

@Yossi Yossi Aug 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry. That was in the heat of the moment as the code was crashing right as i needed it.

I'll edit that comment and it wont happen again.

@reyqn reyqn mentioned this pull request Aug 3, 2016
6 tasks
@AHAAAAAAA AHAAAAAAA deleted the pgoapi-purge branch August 3, 2016 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.