Q: None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, bu ... None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, but after about 30 minutes my iPad's and iPhones can no longer access the library. I see it in the shared list, but no access. more
-
All replies
-
Helpful answers
-
Jun 5, 2012 9:27 AM in response to MIster Volitionby aut0maticdan,doh! good call! I made some adjustments to the script when I was cleaning up and posting it and removed the close! The loop I have running at home does not have this bug.
I confirmed with netstat that it is definitely the case that the script is holding onto the socket. At some point, home sharing is going to reach max connections/file descriptors and will not accept new ones. Sorry about that guys, I posted the fix and confirmed that it no longer holds on to the socket but still detects when its down.
you can just rerun the install script and then launch again:
curl http://djw.s3.amazonaws.com/homesharing-keepalive.rb > ~/Documents/homesharing-keepalive.rb && chmod +x ~/Documents/homesharing-keepalive.rb
###
~/Documents/homesharing-keepalive.rb
-
Jun 5, 2012 9:37 AM in response to aut0maticdanby Davids8477,OK - started testing again.
I'll report the results.
THANKS!!!
-
Jun 5, 2012 12:09 PM in response to Davids8477by aut0maticdan,This is really getting interesting. My little iTunes DoS bug and our getting to the bottom of it may be exposing the root of this problem. I'm happy I goofed!
I'm now conscience of connections to home sharing and am noticing a growing number of open connections in an ESTABLISHED state to 3689 on my mac mini from what I beileve is my appleTV (I will confirm when I get home).
So, this backs up the theory that this is actually an appleTV bug or some combo of appleTV and iTunes. Even if the bug is in appleTV, it could still affect other devices since it basically DoSes home sharing. Either way, the bug could exist or be corrected on either side and its possible that both sides are misbehaving.
I've added some debug to my ruby script so I can get output on the number of connections just before it tries to wake up itunes.
-
Jun 5, 2012 12:44 PM in response to aut0maticdanby aut0maticdan,I've updated the script to report back the number of connections before and after the restart of itunes. If you don't mind, please update and run. I'm running as well, but you may get there quicker than I do.
The output will look like:
Tue Jun 05 15:30:20 -0400 2012 :: Number of HS connections: 1
Home sharing is broken. I am going to restart iTunes.
iTunes restarted
Tue Jun 05 15:30:34 -0400 2012 :: Number of HS connections: 0
If you get a restart, just report back with the output. thanks!
EDIT: Its worth noting that this update does not provide any additional functionality to help resolve the problem. Its purely for my curiosity. Even if the ruby script mitigates the issue, I'll feel much better know what is going wrong. Its just the way I am.
Message was edited by: aut0maticdan
-
Jun 5, 2012 12:57 PM in response to aut0maticdanby MIster Volition,Thanks for the updated script! I've just gotten home and thought I'd check some stuff on my Mac mini (which is sharing the library).
Running netstat from terminal gave me a crazy long list of connections from my AppleTV 3 (over 20 at least). I haven't used the AppleTV 2 in the bedroom since coming back from holiday and powering it all up; it only had one connection listed.
I tried turning both the AppleTVs off, no change with netstat or AppleTV functionality. I tried pulling the network lead out of the Mac Mini, no change in the netstat list. So I tried restarting iTunes, and the netstat list of connections from them vanished and of course the AppleTVs both worked.
Also, when I powered on both AppleTVs, they offered me updates (5.0.2). Since I powered them both up when back home on Sunday and they didn't offer anything then, I'm assuming this is a fresh form Apple update? If so, fingers crossed!
-
Jun 5, 2012 2:02 PM in response to aut0maticdanby cendrizzi,I'm not running the script yet: but I looked at it and took the netstat portion to check my home mini. I have two Apple TV's and apparently 768 HS connectioins.
WOW. Just wow.
Looking closer I noticed almost all those connections have the status CLOSE_WAIT. My familiarity is that this status means the client side has requested a close and is waiting on the server side to do it. That would suggest to me, if this is the case, that it is itunes as we had previously assumed.
Very interesting info though. I wonder what makes it stop responding. Just too many connections for itunes to manage?
-
Jun 5, 2012 2:10 PM in response to cendrizziby aut0maticdan,Yep, I'm noticing the close_wait piling on as well. Very strange! I'm curious to see its breaking point.
EDIT: Oh, one thing worth mentioning. Once you start getting the CLOSE_WAIT connections, the script adds to them every time it iterates, so the testing of the port may accellerate the breakage and then hopefully resolve it.
EDIT 2: Is your home sharing working at this point? I wonder if its broken once the CLOSE_WAITs start accumulating. It will be interesting to see at what point I can't connect and the amount of time in between.
-
Jun 5, 2012 2:09 PM in response to aut0maticdanby SilverSevens,You guys think you're making headway? - The conversation suggests so.
-
Jun 5, 2012 2:16 PM in response to SilverSevensby Davids8477,Well I' running the script show above and normally the library loads within 5-10 seconds. This time it was well over 2 minutes and no load. Nothing in the terminal widown of the script (no messages).
On the server I started a song playing and almost instantly the library loaded on the remote machine.
Maybe a coincidence but its inforamtion.
I'll try it again when (if) I get a loading library hang.
-
Jun 5, 2012 2:24 PM in response to cendrizziby cendrizzi,I have more. The people at my work that this works for (read: they have no issues) I also had them check (running itunes for days). One is on snow leopard and one is on lion.
Both had 2 connections. That's it .
EDIT:
Had one more person with three apple tvs and he has 0 connections.
-
Jun 5, 2012 2:20 PM in response to SilverSevensby cendrizzi,SilverSevens:
You should be able to run netstat -n and see your open connections too. Netstat is on windows as well. Might be interesting to see if you have the same issue on your windows end.
-
Jun 5, 2012 2:22 PM in response to aut0maticdanby cendrizzi,aut0maticdan:
I haven't tested yet but I would bet anything homesharing is down. Besides my few days of good luck it's always down after a couple of hours of non use.
-
Jun 5, 2012 2:35 PM in response to cendrizziby aut0maticdan,I think you are probably right. The good news is we always have the option of switching to checking the number of CLOSE_WAITS on the home sharing TCP port and using that instead to restart!
I'm @1388 with 1263 of them being CLOSE_WAITS.
EDIT: My GF is home and confirmed home sharing is busted.
Message was edited by: aut0maticdan
-
Jun 5, 2012 2:58 PM in response to aut0maticdanby aut0maticdan,I remote-desktopped in and tried playing a song in itunes. It was unstable and crashed. This is all interesting stuff. I'm going back to the drawing board and should have something for later tonight.
-
Jun 5, 2012 3:23 PM in response to aut0maticdanby cendrizzi,866 for me now. Home sharing does NOT work.
683 of those are in CLOSE_WAIT statuses.