3 Replies Latest reply: May 7, 2012 3:47 AM by BKBK RSS

    CFThread getting hung during HTTP call

    Upen@Roul Community Member

      Hi All,

       

      I am using one java library(RETSIQ) to get data from RETS Server which uses HTTP call to get the data.

      And I am using ColdFusion thread to get data from different RETS servers simultaneously and write that in separate data files.

       

      But, sometimes my CF thread getting hung and I am getting the following Java Stack Strace when I am monitoring that thread:

       

      java.net.SocketInputStream.socketRead0(Native Method),java.net.SocketInputStream.read(SocketInputStream.java:129),java.io.BufferedInput Stream.fill(BufferedInputStream.java:218),java.io.BufferedInputStream.read(BufferedInputSt ream.java:237),org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77),or g.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105),org.apache.commons.ht tpclient.HttpConnection.readLine(HttpConnection.java:1113),org.apache.commons.httpclient.H ttpMethodBase.readStatusLine(HttpMethodBase.java:1832),org.apache.commons.httpclient.HttpM ethodBase.readResponse(HttpMethodBase.java:1590),org.apache.commons.httpclient.HttpMethodB ase.execute(HttpMethodBase.java:995),org.apache.commons.httpclient.HttpMethodDirector.exec uteWithRetry(HttpMethodDirector.java:395),org.apache.commons.httpclient.HttpMethodDirector .executeMethod(HttpMethodDirector.java:170),org.apache.commons.httpclient.HttpClient.execu teMethod(HttpClient.java:396),com.bigllc.retsiq.client.RETSClient.execute(RETSClient.java: 536),com.bigllc.retsiq.client.RETSClient.search(RETSClient.java:365),com.bigllc.retsiq.sim pleclient.RETSUserSession.search(RETSUserSession.java:901),com.bigllc.retsiq.simpleclient. RETSUserSession.search(RETSUserSession.java:264),com.bigllc.retsiq.simpleclient.RETSUserSe ssion.search(RETSUserSession.java:233),sun.reflect.GeneratedMethodAccessor71.invoke(Unknow n  Source),sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java :25),java.lang.reflect.Method.invoke(Method.java:597),coldfusion.runtime.StructBean.invoke (StructBean.java:508),coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393),cfRETSConn ectionFactory2ecfc714760613$funcSEARCHRETSSERVERRETSIQ.runFunction(......),

      coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472),coldfusion.filter.SilentFilter.inv oke(SilentFilter.java:47),coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.j ava:405),coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368), coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55),coldfusion.run time.UDFMethod.runFilterChain(UDFMethod.java:321),coldfusion.runtime.UDFMethod.invoke(UDFM ethod.java:220),coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491),coldfusion .runtime.TemplateProxy.invoke(TemplateProxy.java:337),coldfusion.runtime.CfJspPage._invoke (CfJspPage.java:2360),cfinc_Control_TaskSchedule2ecfm1033346474$func_CFFUNCCFTHREAD_CFINC_ CONTROL_TASKSCHEDULE2ECFM10333464741._factor9(),cfinc_Control_TaskSchedule2ecfm1033346474$ func_CFFUNCCFTHREAD_CFINC_CONTROL_TASKSCHEDULE2ECFM10333464741._factor15(....),

      cfinc_Control_TaskSchedule2ecfm1033346474$func_CFFUNCCFTHREAD_CFINC_CONTROL_TASKSCHEDULE2E CFM10333464741._factor16(),cfinc_Control_TaskSchedule2ecfm1033346474$func_CFFUNCCFTHREAD_C FINC_CONTROL_TASKSCHEDULE2ECFM10333464741.runFunction),

      coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472),coldfusion.runtime.UDFMethod$Argum entCollectionFilter.invoke(UDFMethod.java:368),coldfusion.filter.FunctionAccessFilter.invo ke(FunctionAccessFilter.java:55),coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.jav a:321),coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220),coldfusion.runtime.UDFMetho d.invokeCFThread(UDFMethod.java:201),coldfusion.thread.Task.invokeFunction(Task.java:274), coldfusion.thread.Task.run(Task.java:140),coldfusion.scheduling.ThreadPool.run(ThreadPool. java:201),coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)

       

       

       

      Can any one please tell me what is cause of the issue and what will be the solutions for it.

       

      Thanks

        • 1. Re: CFThread getting hung during HTTP call
          BKBK MVP

          I haven't got the picture yet. What is the relationship between the Java library and the ColdFusion thread? Are you indeed using one "ColdFusion thread to get data from different RETS servers simultaneously and write that in separate data files."? If so, that just might be too much for one thread to do. The moment I see read-processes hanging at a socket, the usual suspects come to mind, namely, long-running queries.

          • 2. Re: CFThread getting hung during HTTP call
            Upen@Roul Community Member

            Thanks for you reply.

             

            - I am using RETSIQ java library to communicate with RETS Server.

            - In our application there is more than 50 MLS servers are there. So, during downloading that data from different server we create a separate coldfusion thread and then we read data from the server and write that to a text file.

            - We have limited our thread creation to some limit. So that when the limit is reached no CF thread will be created further.

             

             

            My Problem is:

             

            - Sometimes the ColdFusion thread is hanging at the time of data transfer and thread will be live till you kill the thread manually by CF admin API.

             

             

            I want to know : Is there any way to avoid the thread hanging ???

             

            Thanks

            • 3. Re: CFThread getting hung during HTTP call
              BKBK MVP

              Could you show us the relevant part of the code? It seems like the hanging is caused by race conditions.