[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
Stuart Douglas commented on WFLY-5731:
--------------------------------------
This XNIO commit may fix the problem: https://github.com/xnio/xnio/compare/3.x...stuartwdouglas:finalize?expand=1
Unfortunately if you create and destroy a lot of threads very quickly it may be that GC cannot keep up and you will run out of FD's anyway. You are much better off using some kind of thread pool, as it will perform much better anyway.
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
Stuart Douglas commented on WFLY-5731:
--------------------------------------
[~dmlloyd] it looks like PollSelectorImpl has no finalize(), so if blocking IO is done from a short lived thread the FD will leak.
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
Stuart Douglas commented on WFLY-5731:
--------------------------------------
Ah, this is because XNIO caches the poll selector in a ThreadLocal. If you use an ExecutorService or some other fixed thread pool you will not have the issue. It still should be GCed at some point though.
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
Stuart Douglas reopened WFLY-5731:
----------------------------------
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by 浩 陈 (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
浩 陈 commented on WFLY-5731:
---------------------------
we have tried both wildfly9.0.2 and 10.0.CR4, it seems nothing changed.
I think This leak's reason maybe that:
When the thread writing this big data, output writer writes go beyond it's buffer size, then it creates a PollSelectorImpl and wait until this buffer available. After response Data writes successfully, this thread will be GCed by JVM, PollSelectorImpl also be GCed.
PollSelectorImpl have create two FD but Never close them.
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-5731.
----------------------------------
Resolution: Duplicate Issue
Looks like a duplicate of https://issues.jboss.org/browse/WFLY-4397
> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
> Key: WFLY-5731
> URL: https://issues.jboss.org/browse/WFLY-5731
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
> Reporter: 浩 陈
> Assignee: Stuart Douglas
> Priority: Critical
> Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this:
> protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
> resp.setContentType("text/html;charset=UTF-8");
> AsyncContext ctx = req.startAsync();
> new Thread(new Executor(ctx)).start();
> }
> public class Executor implements Runnable {
> private AsyncContext ctx = null;
> public Executor(AsyncContext ctx) {
> this.ctx = ctx;
> }
> public void run() {
> try {
> char[] data = new char[1024 * 1024 * 1];
> PrintWriter out = ctx.getResponse().getWriter();
> out.write(data);
> out.flush();
> ctx.complete();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months
[JBoss JIRA] (WFLY-3608) Expose configuring allowed file extensions
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-3608?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-3608.
----------------------------------
Resolution: Rejected
The default has now been changed all file types are allowed, so I don't think this is necessary any more
> Expose configuring allowed file extensions
> ------------------------------------------
>
> Key: WFLY-3608
> URL: https://issues.jboss.org/browse/WFLY-3608
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final
> Environment: CentOs 5.5 & Ubuntu 10.04/12.04, Wildfly 8.1.0 Final, java version 1.7.0_60
> Reporter: Thomas Brenna
> Assignee: Stuart Douglas
> Fix For: 10.0.0.CR5
>
>
> It should be possible to modify allowed extensions without adding web.xml entry as we have it now.
> It should be an configuration option of servlet-container element. in undertow subsystem.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 7 months