Chúng tôi có một vấn đề trong sản xuất cho thời gian khá bây giờ ...Trình mô tả tệp bị rò rỉ khi nhận mã phản hồi. (CXF, ssl)
Đây là một theo dõi của: my other question nhưng với cách chi tiết cụ thể vì vậy tôi nghĩ rằng đăng nó như là một câu hỏi mới là hợp lý (nếu không, tôi sẽ chỉ thêm thông tin này vào câu hỏi khác).
Ở đây nó đi:
Vì vậy, chúng tôi có một rò rỉ bộ mô tả tập tin trên aix với (ibm) java 6 WebLogic sử dụng một ứng dụng sử dụng CXF và chúng tôi giải quyết một dịch vụ web của riêng của chúng tôi một cũng là một NHTMCP mà các tuyến đường hướng ws của chúng tôi.
Khi sử dụng File Leak Detector làm tác nhân trong quá trình khởi động weblogic và bán phương thức getCurrentOpenFiles() và lọc trên Listener.SocketRecord theo chương trình chúng tôi có 2000 ổ cắm mở;
Đây là những ổ cắm java và mô tả tập tin, mạng-socket (xem với trình netstat) đều được đóng đúng cách, theo thời gian, nhưng những người theo chương trình (và những người xem với
lsof -p $pid_of_managed_server 2> /dev/null|grep TCP|wc -l
) lại mở (và cuối cùng gây ra quá nhiều vấn đề mở tệp)).
này là người đứng đầu của ngăn xếp của một trong những mô tả tập tin mở bên trong JVM:
record socket to tst-cjcsr.just.fgov.be/10.239.7.19:443 by thread:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' on Thu Nov 10 10:25:56 CET 2016
at java.net.PlainSocketImpl.create(PlainSocketImpl.java:188)
at java.net.Socket.createImpl(Socket.java:411)
at java.net.Socket.connect(Socket.java:544)
at weblogic.net.http.HttpsClient.openWrappedSSLSocket(HttpsClient.java:565)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:296)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:373)
at weblogic.net.http.HttpsClient.New(HttpsClient.java:528)
at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:239)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:409)
at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
at weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:1038)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode(URLConnectionHTTPConduit.java:266)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doProcessResponseCode(HTTPConduit.java:1550)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1579)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1317)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
at com.sun.proxy.$Proxy380.requestCriminalRecord(Unknown Source)
at be.fgov.just.cjr.application.dossier.DossierBean$1.call(DossierBean.java:225)
tôi có thể tưởng tượng rằng đây là một vấn đề applicative bởi vì tôi không thể tìm thấy những trường hợp khác trực tuyến với các khuyết tật tương tự .
Có ai có thể hiểu rõ hơn từ ngăn xếp này không?
Ví dụ: Nó tấn công tôi như lẻ mà HTTPConduit.close() muốn tạo một kết nối ...
điểm khác: vấn đề này không xảy ra với chồng cùng một công nghệ cho người không -các cuộc gọi nhanh. (Mà không có ý nghĩa vì stacktrace đề cập Http s Client)
CXF phiên bản: 2.7.18
CXF config:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<context:property-placeholder location="file:${config.file.location}cjr-extract-${cjr.environment}.properties"/>
<jaxws:client id="CJCSCGService"
serviceClass="be.fgov.just.cjr.ws.extract.generated.CJCSCGService"
address="${ws.extract.wsdl.endpoint}">
<jaxws:binding>
<soap:soapBinding version="1.2"/>
</jaxws:binding>
</jaxws:client>
<cxf:bus>
<cxf:outInterceptors>
<bean class="our.package.interceptors.SomeInterceptor"
id="webSecurityInterceptor">
<constructor-arg>
<map>
<entry key="action" value="Timestamp Signature"/>
<entry key="user" value="${org.apache.ws.security.crypto.merlin.keystore.alias}"/>
<entry key="passwordCallbackRef">
<ref bean="passwordCallBack"/>
</entry>
<!--entry key="signaturePropFile" value="properties/our.properties"/-->
<entry key="signaturePropFile" value="file:${location}/our.properties"/>
<entry key="signatureKeyIdentifier" value="DirectReference" />
</map>
</constructor-arg>
</bean>
</cxf:outInterceptors>
<cxf:properties>
<entry key="signatureParts"
value="{Element}{http://www.w3.org/2003/05/soap-envelope}Body;{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp"/>
</cxf:properties>
</cxf:bus>
<bean id="passwordCallBack" class="our.package.authentication.PasswordCallbackHandler">
<property name="password" value="${password}"/>
<property name="alias" value="${org.apache.ws.security.crypto.merlin.keystore.alias}"/>
</bean>
</beans>
Java:
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap3260sr15fp1-20140110_01(SR15 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr15-
20131231_180656 (JIT enabled, AOT enabled)
J9VM - 20131231_180656
JIT - r9_20130920_46510ifx3
GC - GA24_Java6_SR15_20131231_1152_B180656)
JCL - 20140107_01
WebLogic 10,3 .6
Cảm ơn các gợi ý, con trỏ, và, tất nhiên - nếu có thể -, câu trả lời ;-)
S.
EJP yêu cầu mã, ở đây là:
Cuộc gọi riêng của mình:
private CJCSCGService cjcscgService;
private Callable<RequestCriminalRecordResponse> callService(final RequestCriminalRecordRequest request) {
return new Callable<RequestCriminalRecordResponse>() {
@Override
public RequestCriminalRecordResponse call() throws Exception {
try {
return cjcscgService.requestCriminalRecord(request); // this is line 225.
} catch (Exception e) {
facesMessages.error("technicalError");
log.error("Encountered technical error", e);
return null;
}
}
};
}
Các webservice tạo:
package be.fgov.just.cjr.ws.extract.generated;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.1.7-b01-
* Generated source version: 2.1
*
*/
@WebService(name = "CJCSCGService", targetNamespace = "http://secret/service-v1.0-rc2")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@XmlSeeAlso({
ObjectFactory.class
})
public interface CJCSCGService {
/**
*
* @param requestCriminalRecordRequest
* @return
* returns be.fgov.just.cjr.ws.extract.generated.RequestCriminalRecordResponse
*/
@WebMethod(action = "http://secret/service/RequestCriminalRecord")
@WebResult(name = "requestCriminalRecordResponse", targetNamespace = "http://secret/service-v1.0-rc2", partName = "requestCriminalRecordResponse")
public RequestCriminalRecordResponse requestCriminalRecord(
@WebParam(name = "requestCriminalRecordRequest", targetNamespace = "http://secret/service-v1.0-rc2", partName = "requestCriminalRecordRequest")
RequestCriminalRecordRequest requestCriminalRecordRequest);
}
với:
<http-conf:conduit name="*.http-conduit">
<http-conf:client Connection="Close" />
</http-conf:conduit>
Các kết nối (os level) đóng; nhưng chúng tôi vẫn còn bị rò rỉ (hành vi nêu trên).
với:
<http-conf:conduit name="*.http-conduit">
<http-conf:client Connection="Keep-Alive" />
</http-conf:conduit>
Cả các kết nối (cấp os) là file descriptor tiếp tục đi lên ...
(thông tin bổ sung: các kết nối mức os đi xuống (sau thời gian ra tôi đoán) nhưng các bộ mô tả tập tin vẫn mở ...)
@EJP Sự cố trong cấu hình CXF. Đây là lý do tại sao không có mã. Tôi không thể đi và dán mã của CXF: chúng tôi chỉ không biết những gì đang xảy ra trong nội bộ đó. Bạn muốn mã gọi? Tốt thôi, đó là không có vấn đề, sẽ được thực hiện trong một vài phút, nhưng nó sẽ không cung cấp cho bạn bất kỳ gợi ý nhiều hơn nữa. –
@EJP: Tất cả các mô tả tệp mở dường như bị kẹt tại java.net.PlainSocketImpl.create (PlainSocketImpl.java:188); chúng ta có thể tìm kiếm mã này trong OpenJdk nhưng không phải trong mã OpenJdk của IBM (gây ra vấn đề) hơn nữa; stacktrace sử dụng rất nhiều mã nội bộ weblog, được gọi bởi cxf, mà chúng tôi gọi, nhưng mã của chúng tôi bị giới hạn trong mã Olivier được cung cấp (với cấu hình tôi đã cung cấp) – Bamboomy
bạn đã thử hết giờ chưa? Nếu bạn chưa kiểm tra, tôi đã tìm thấy sự cố này http://stackoverflow.com/questions/5656458/java-net-socketexception-too-many-open-files/37605213#37605213 – HRgiger