Giter Club home page Giter Club logo

music-inbox's People

Contributors

aroscoe avatar fberger avatar mnutt avatar tjulien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

music-inbox's Issues

Album fetcher thread throws exception

Probably from bad data or something...

DEBUG:album_diff:Galactic ...
Ya-Ka-May ...
Exception in thread Thread-3:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 522, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 477, in run
self.__target(_self.__args, *_self.__kwargs)
File "/Library/Python/2.6/site-packages/django/dispatch/dispatcher.py", line 166, in send
response = receiver(signal=self, sender=sender, *_named)
File "/Users/michael/code/music-inbox/apps/library/utils/importer.py", line 26, in itunes
signals.import_done.send(sender=self, library=library)
File "/Library/Python/2.6/site-packages/django/dispatch/dispatcher.py", line 166, in send
response = receiver(signal=self, sender=sender, *_named)
File "/Users/michael/code/music-inbox/apps/library/utils/mb.py", line 34, in album_diff
mb_artist_entry.fetch_albums()
File "/Users/michael/code/music-inbox/apps/library/models.py", line 87, in fetch_albums
date, asin = self.get_release_date(release.id)
File "/Users/michael/code/music-inbox/apps/library/models.py", line 101, in get_release_date
release = release_group.releases[0] # TODO iterate over all
IndexError: list index out of range

fetch_albums() needs to be single threaded

currently each library upload spawns a new thread to import the albums. This ends up hitting the musicbrainz ws. There is rate limiting (i.e., time.sleep(1) ). However, these calls are not synchronized across threads, which means concurrent library importing will end up hitting musicbrainz ws more than it should, resulting in HTTP 502 error codes.

Possible solutions include a single thread doing all imports or synchronization around all musicbrainz calls (not even sure if python can do that).

Heavier but more fun solutions include using a message queue with each import thread as a producer with a single consumer on the other end.

interrmittent 502s

even with rate limiting, sometimes musicbrainz is sending back HTTP 502, but only randomly. It seems to happen during library import after awhile. Musicbrainz requires rate limiting of 1 req / sec / IP. I believe all of our musicbrainz calls have the necessary sleep, but I could be wrong. I have even tried sleep()'ing for 2 seconds, twice what they require. I believe at this point we probably need to wrap all musicbrainz calls in try... except in an infinite loop and do exponential backoff for timeouts, or some such

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.