timeout needed for artist pull

Bug #682506 reported by Andrew Barr on 2010-11-28
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Viridian
High
Dave Eddy

Bug Description

Hi, Viridian is pretty neat but I have a problem. Not everyone has a super-fast server for their Ampache instance, and it looks like the default urllib2 timeout for pulling the Artist XML file is not enough. timeout=30 added to the .urlopen() call seems to work quite nicely for me.

Dave Eddy (daveeddydotcom) wrote :

Hey, yeah I just had my first issue with this when trying to pull 5000 songs from my Ampache server; I saw my CPU's spike to 100% and realized that a timeout issue was happening because of that.. I just pushed a new commit that changes the timeout from 5 seconds to 10 seconds globally.. but i'm thinking i might have to change it to a higher value for certain functions (such as pulling artists/albums/songs)

Changed in viridianplayer:
assignee: nobody → Dave Eddy (daveeddydotcom)
importance: Undecided → High
status: New → Fix Committed
John Kallevik (john-kallevik) wrote :

Hi, new Viridian user here, seem to have run into this bug;
---------------------------------------------------
Error Pulling Data! -- Check Ampache
<urlopen error The read operation timed out>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/AmpacheTools/AmpacheGUI.py", line 2171, in button_reauthenticate_clicked
    self.login_and_get_artists(True)
  File "/usr/lib/python2.6/site-packages/AmpacheTools/AmpacheGUI.py", line 1801, in login_and_get_artists
    self.check_and_populate_artists()
  File "/usr/lib/python2.6/site-packages/AmpacheTools/AmpacheGUI.py", line 2664, in check_and_populate_artists
    artists = self.ampache_conn.get_artists()
  File "/usr/lib/python2.6/site-packages/AmpacheTools/AmpacheSession.py", line 270, in get_artists
    list += self.get_artists(i)
TypeError: 'NoneType' object is not iterable
-----------------------------------------
This is running the standard download version, is there an update somewhere to fix it?

Best Regards,
John

hoarak (f-weik) wrote :

Wouldn't it be cleaner if you'd fetch the data in chunks of the same size and set a timeout for that? The ampache api lets you set an limit and an offset for a request. Otherewise there'll be allways a user who has a request that ist big enough to time out. ;-) At least the timeout should be configurable because this depends on the server and its use and this can never be forseen.

Best Regards

Andrew Barr (andrew-james-barr) wrote :

I disagree. I think there is a reasonable value which can cover the vast majority of users. Because at some point things lower down the stack such as TCP are going to time out. Those users have other problems.

Dave Eddy (daveeddydotcom) wrote :

@ #2
As of right now there is no new version that will cover this timeout issue, but I am working on it for the next version so if you pull the newest code from me with 'bzr checkout lp:viridianplayer' this issue should hopefully be resolved.

@ #3,#4
I agree with the idea that there is a reasonable value that can cover the majority of users. However, after setting that value as the default timeout there's no reason I can't make an override for that value somewhere in the settings under an "advanced" section or something like that.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers