Android leaking connections?

Need help? Post your questions here.

Moderator: moderators

Android leaking connections?

Postby jol » Sat Feb 04, 2012 11:20 am

Hello,
after installating a new USB sound card on my WHS I am now using Android to remote control the server. As the server is configured to go to standby automatically if not serving anyone, I was looking for a means to figure out subsonic is playing music. One idea was to look for established connections, as Android is continously updating the status. Thus I ran netstat -a | find "4443" (4443 is the listening port of subsonic) and got
Code: Select all
C:\Users\Joachim>netstat -a | find "4443"
  TCP    0.0.0.0:4443           server:0               LISTENING
  TCP    192.168.177.3:4443     port-92-200-120-61:57066  CONNECTED
  TCP    192.168.177.3:4443     port-92-200-120-61:58241  CONNECTED
  TCP    192.168.177.3:4443     android_9774d56d682e549c:39845  CONNECTED
  TCP    192.168.177.3:4443     android_9774d56d682e549c:44354  CONNECTED
  TCP    192.168.177.3:4443     android_9774d56d682e549c:49153  CONNECTED
  TCP    192.168.177.3:4443     android_9774d56d682e549c:49542  CONNECTED
  TCP    [::]:4443              server:0               LISTENING
and the list increases over time, and none of the connections is closed even if I terminate subsonic on Android or switch to another server (which is otherwise quite disruptive). My expectation would be that subsonic reuses the connection/port to the extend possible, or if not possible closes the connection.

Problem Description: likely connection leak
Troubleshooting Steps: standard usage, switch server
Playback Application and version: Subsonic for Android 3.3
Subsonic Version: 4.6 (build 2583) – December 6, 2011
Server Version: jetty-6.1.x, java 1.6.0_27, Windows Server 2008 R2 (86.5 MB / 96.7 MB) -
Hardware Platform: Windows Homeserver 2011
Java Memory Limit: 100MB
Problem Filename: no specific file, tried several
Output from ffmpeg -i:
Code: Select all
c:\subsonic\transcode>ffmpeg -i "E:\ServerFolders\Musik\a-ha\Foot of the Mountai
n\03 What There Is.m4a"
ffmpeg version N-31653-gfaa3381, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 28 2011 01:57:12 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-
runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  9. 0 / 53.  9. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 27. 3 /  2. 27. 3
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\ServerFolders\Musik\a-ha\Foot of the
Mountain\03 What There Is.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 0
    compatible_brands: M4A mp42isom
    title           : What There Is
    artist          : a-ha
    album_artist    : a-ha
    composer        : Paul Waaktaar-Savoy & Magne Furuholmen
    album           : Foot of the Mountain
    track           : 3
    disc            : 1
    date            : 2009-12-04T08:00:00Z
    copyright       : Ôäù 2009 a-ha network as under exclusive license to We Lov
e Music, distributed by Universal Music Domestic Pop, a division of Universal Mu
sic GmbH
  Duration: 00:03:42.60, start: 0.000000, bitrate: 283 kb/s
    Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 261 kb/s
At least one output file must be specified

Last ten log file lines:
Code: Select all
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libswscale 2. 0. 0 / 2. 0. 0
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) [mp3 @ 02039F20] max_analyze_duration 5000000 reached at 5015510
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Input #0, mp3, from 'E:\ServerFolders\Musik\Chris deBurgh\The Getaway\Chris de Burgh - Borderline.mp3':
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Metadata:
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) album_artist : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) album : The Getaway
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) title : Borderline
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) track : 08
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) genre : Pop
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) publisher : Universal International
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) TLEN : 281613
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) composer : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) artist : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) date : 1982
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Duration: 00:04:41.67, start: 0.000000, bitrate: 192 kb/s
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Output #0, au, to 'pipe:':
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Metadata:
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) album_artist : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) album : The Getaway
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) title : Borderline
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) track : 08
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) genre : Pop
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) publisher : Universal International
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) TLEN : 281613
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) composer : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) artist : Chris de Burgh
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) date : 1982
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) encoder : Lavf53.6.0
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0: Audio: pcm_s16be, 44100 Hz, stereo, s16, 1411 kb/s
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream mapping:
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0 -> #0.0
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Press [q] to stop, [?] for help
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) size= 48524kB time=00:04:41.67 bitrate=1411.2kbits/s 
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) 
[2/4/12 12:02:06 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) video:0kB audio:48524kB global headers:0kB muxing overhead 0.000048%
[2/4/12 12:02:06 PM CET] DEBUG JukeboxService Closed line com.sun.media.sound.DirectAudioDevice$DirectSDL@2130c2
[2/4/12 12:02:06 PM CET] INFO JukeboxService Joachim stopping jukebox for "The Getaway\Chris de Burgh - Borderline.mp3"
[2/4/12 12:02:06 PM CET] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [0] [-i] [E:\ServerFolders\Musik\Chris deBurgh\The Getaway\Chris de Burgh - Where Peaceful Waters Flow.mp3] [-v] [0] [-f] [au] [-] 
[2/4/12 12:02:07 PM CET] DEBUG JukeboxService Opened line com.sun.media.sound.DirectAudioDevice$DirectSDL@a1fdd8
[2/4/12 12:02:07 PM CET] INFO JukeboxService Joachim starting jukebox for "The Getaway\Chris de Burgh - Where Peaceful Waters Flow.mp3"
[2/4/12 12:10:46 PM CET] DEBUG JukeboxService Closed line com.sun.media.sound.DirectAudioDevice$DirectSDL@a1fdd8
[2/4/12 12:10:46 PM CET] INFO JukeboxService Joachim stopping jukebox for "The Getaway\Chris de Burgh - Where Peaceful Waters Flow.mp3"
[2/4/12 12:10:46 PM CET] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [0] [-i] [E:\ServerFolders\Musik\Compilations\NRJ Music Awards 2012\Angelina Jolie & Brad Pitt RC Moments 2009.mp3] [-v] [0] [-f] [au] [-] 
[2/4/12 12:10:46 PM CET] DEBUG JukeboxService Opened line com.sun.media.sound.DirectAudioDevice$DirectSDL@1af78ce
[2/4/12 12:10:46 PM CET] INFO JukeboxService Joachim starting jukebox for "NRJ Music Awards 2012\Angelina Jolie & Brad Pitt RC Moments 2009.mp3"
[2/4/12 12:13:10 PM CET] INFO VersionService Resolved local Subsonic version to: 4.6
[2/4/12 12:13:11 PM CET] INFO VersionService Resolved latest Subsonic final version to: 4.6
[2/4/12 12:13:11 PM CET] INFO VersionService Resolved latest Subsonic beta version to: 4.6.beta2

What do you think?
Thanks, jol
Subsonic 4.7 running on Acer H340 with LDAP authentication / Windows Home Server 2011 - Android client (3.5)
jol
 
Posts: 52
Joined: Sat Jan 21, 2012 7:40 pm

Re: Android leaking connections?

Postby jol » Sat Feb 04, 2012 7:56 pm

What I would consider even worse is that also the server obviously never closes connections that are not used any longer. This can not only be a resource consumption issue but also ease denial of service attacks. Can you please close any connection not reused after say 300s ? Is there a limit on the number of open connections or do you wait until memory is exhausted?
Thanks, jol
Subsonic 4.7 running on Acer H340 with LDAP authentication / Windows Home Server 2011 - Android client (3.5)
jol
 
Posts: 52
Joined: Sat Jan 21, 2012 7:40 pm

Re: Android leaking connections?

Postby noah » Wed Jun 20, 2012 5:32 am

Hi, I am having the exact same problem as the OP-- server is configured to standby when idle for some time, but can't figure out how to tell if Subsonic has active clients. I was also trying netstat, but it doesn't help since the connections aren't closed when the Android client is stopped.
I've searched and found verisons of this question but no answers. Any suggestions?
Thanks
noah
 
Posts: 1
Joined: Wed Jun 20, 2012 5:13 am

Re: Android leaking connections?

Postby jol » Wed Jun 20, 2012 6:19 am

I solved the idle standby problem with a task that searches the log file for INFO JukeboxService and then prevents Lights Out from standby, if you are also using LO I can share the details. But anyway I think the resource leak is a bug to be addressed independently of the idle topic.
My current configuration hides Subsonic (Jetty) behind IIS with ARR - I haven´t checked yet whether this helps.
Best regards, jol
Subsonic 4.7 running on Acer H340 with LDAP authentication / Windows Home Server 2011 - Android client (3.5)
jol
 
Posts: 52
Joined: Sat Jan 21, 2012 7:40 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 13 guests