[JBoss JIRA] (JBJCA-1276) Prefill race condition in flush
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/JBJCA-1276?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on JBJCA-1276:
------------------------------------------------
Jan Martiska <jmartisk(a)redhat.com> changed the Status of [bug 1231658|https://bugzilla.redhat.com/show_bug.cgi?id=1231658] from VERIFIED to ASSIGNED
> Prefill race condition in flush
> -------------------------------
>
> Key: JBJCA-1276
> URL: https://issues.jboss.org/browse/JBJCA-1276
> Project: IronJacamar
> Issue Type: Bug
> Affects Versions: 1.0.31.Final, 1.1.9.Final
> Reporter: Takayoshi Kimura
> Assignee: Jesper Pedersen
> Fix For: 1.0.33.Final
>
> Attachments: server.log
>
>
> There is a race condition between AbstractPool and SemaphoreArrayListManagedConnectionPool.
> https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.31.Final/...
> https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.31.Final/...
> AbstractPool flushes the mcp, mcp invokes PoolFiller which works in a separate thread. However AbstractPool is going to unregister the empty mcp and this mcp is no longer used. Then the dead mcp is prefilled in a separate thread by PoolFiller.
> At next getConnection(), the mcp is re-initialized and prefilled.
> I've attached logs, prefill enabled and min-size is 10. Boot server, invoke flush-all-connection-in-pool, getConnection() then killed. The prefill is done 3 times where it should be twice.
> {noformat}
> 16:26:04,254 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (management-handler-thread - 1) ExampleDS: flush(true)
> 16:26:04,255 TRACE [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (management-handler-thread - 1) Destroying flushed connection org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1d298ed8[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@4ae26a1b connection handles=0 lastUse=1434353148384 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@56a43905 pool internal context=SemaphoreArrayListManagedConnectionPool@5cbd770e[pool=ExampleDS] xaResource=LocalXAResourceImpl@379ba3b3[connectionListener=1d298ed8 connectionManager=4b18594a warned=false currentXid=null productName=H2 productVersion=@PROJECT_VERSION@ (2012-07-13) jndiName=java:jboss/datasources/ExampleDS] txSync=null]
> (repeat 10 times)
> 16:02:20,666 TRACE [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (management-handler-thread - 7) Shutdown - Pool: ExampleDS MCP: 2f5a2102
> 16:02:20,666 TRACE [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (JCA PoolFiller) Using properties: {user=sa, password=--hidden--}
> 16:02:20,666 DEBUG [org.jboss.jca.core.connectionmanager.pool.idle.IdleRemover] (management-handler-thread - 7) Unregister pool: SemaphoreArrayListManagedConnectionPool@2f5a2102[pool=ExampleDS]
> 16:26:04,259 TRACE [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) Filling pool cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@34f0bb27[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@288f1898 connection handles=0 lastUse=1434353164259 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@56a43905 pool internal context=SemaphoreArrayListManagedConnectionPool@5cbd770e[pool=ExampleDS] xaResource=LocalXAResourceImpl@4a97b7f5[connectionListener=34f0bb27 connectionManager=4b18594a warned=false currentXid=null productName=H2 productVersion=@PROJECT_VERSION@ (2012-07-13) jndiName=java:jboss/datasources/ExampleDS] txSync=null]
> (repeat 10 times)
> 16:26:11,342 TRACE [org.jboss.jca.core.connectionmanager.TxConnectionManager] (http-/127.0.0.1:8080-1) getManagedConnection interleaving=false , tx=null
> 16:26:11,343 DEBUG [org.jboss.jca.core.connectionmanager.pool.idle.IdleRemover] (http-/127.0.0.1:8080-1) Register pool: SemaphoreArrayListManagedConnectionPool@1d4ae61f[pool=ExampleDS] (interval=1800000)
> 16:26:11,344 TRACE [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) Filling pool cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1c706b4d[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@18949ad1 connection handles=0 lastUse=1434353171343 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@56a43905 pool internal context=SemaphoreArrayListManagedConnectionPool@1d4ae61f[pool=ExampleDS] xaResource=LocalXAResourceImpl@44401bf2[connectionListener=1c706b4d connectionManager=4b18594a warned=false currentXid=null productName=H2 productVersion=@PROJECT_VERSION@ (2012-07-13) jndiName=java:jboss/datasources/ExampleDS] txSync=null]
> (repeat 10 times)
> {noformat}
> In 1.0.31.Final:
> > if (mcp.isEmpty())
> > clearMcpPools.add(mcp);
> In 1.2 branch it looks like already fixed within commit 956af09c8494d4187db24a253e7e37b5ba5d9779 for JBJCA-1135:
> > if (mcp.isEmpty() && !isPrefill() && size > 1)
> > clearMcpPools.add(mcp);
> We probably need to backport "!isPrefill()" to the 1.0/1.1 branch.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (WFLY-5638) "Buffer was already freed" error from http request processing
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-5638?page=com.atlassian.jira.plugin.... ]
Stuart Douglas commented on WFLY-5638:
--------------------------------------
If you can confirm that Wildfly 10 fixes it then I can give you more info, otherwise I would just be speculating (but I think it probably is the cause of the socket leak).
> "Buffer was already freed" error from http request processing
> -------------------------------------------------------------
>
> Key: WFLY-5638
> URL: https://issues.jboss.org/browse/WFLY-5638
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 9.0.1.Final
> Reporter: Arto Huusko
> Assignee: Stuart Douglas
> Attachments: stacktrace.txt
>
>
> Undertow causes XNIO exception "Buffer was already freed" during response write, possibly due to premature client close.
> I suspect this may also cause the socket to leak, because the number of "Buffer was already freed" messages in widlfly server.log corresponds to the number of leaked sockets in the lsof command output for the wildfly process (seen as sockets with "can't identify protocol" description).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (JBVFS-201) VirtualFile and SuffixMatchFilter not necessary char allocation
by Konstantin Bulanov (JIRA)
[ https://issues.jboss.org/browse/JBVFS-201?page=com.atlassian.jira.plugin.... ]
Konstantin Bulanov updated JBVFS-201:
-------------------------------------
Description:
org.jboss.vfs.util.SuffixMatchFilter#accepts duplicate formating and string concationation
org.jboss.vfs.VirtualFile#getPathName(boolean) use recursive string concatenation with new StringBuilder for eacht step, as result we allocate annesesary char[] during start server.
was:
org.jboss.vfs.util.SuffixMatchFilter#accepts dublicate formating and string concationation
org.jboss.vfs.VirtualFile#getPathName(boolean) use recursive string concatenation with new StringBuilder for eacht step, as result we allocate annesesary char[] during start server.
> VirtualFile and SuffixMatchFilter not necessary char allocation
> ---------------------------------------------------------------
>
> Key: JBVFS-201
> URL: https://issues.jboss.org/browse/JBVFS-201
> Project: JBoss VFS
> Issue Type: Enhancement
> Affects Versions: 3.2.9.Final
> Reporter: Konstantin Bulanov
> Assignee: Tomaz Cerar
> Priority: Minor
>
> org.jboss.vfs.util.SuffixMatchFilter#accepts duplicate formating and string concationation
> org.jboss.vfs.VirtualFile#getPathName(boolean) use recursive string concatenation with new StringBuilder for eacht step, as result we allocate annesesary char[] during start server.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (JBVFS-201) VirtualFile and SuffixMatchFilter not necessary char allocation
by Konstantin Bulanov (JIRA)
[ https://issues.jboss.org/browse/JBVFS-201?page=com.atlassian.jira.plugin.... ]
Konstantin Bulanov updated JBVFS-201:
-------------------------------------
Description:
org.jboss.vfs.util.SuffixMatchFilter#accepts dublicate formating and string concationation
org.jboss.vfs.VirtualFile#getPathName(boolean) use recursive string concatenation with new StringBuilder for eacht step, as result we allocate annesesary char[] during start server.
> VirtualFile and SuffixMatchFilter not necessary char allocation
> ---------------------------------------------------------------
>
> Key: JBVFS-201
> URL: https://issues.jboss.org/browse/JBVFS-201
> Project: JBoss VFS
> Issue Type: Enhancement
> Affects Versions: 3.2.9.Final
> Reporter: Konstantin Bulanov
> Assignee: Tomaz Cerar
> Priority: Minor
>
> org.jboss.vfs.util.SuffixMatchFilter#accepts dublicate formating and string concationation
> org.jboss.vfs.VirtualFile#getPathName(boolean) use recursive string concatenation with new StringBuilder for eacht step, as result we allocate annesesary char[] during start server.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (WFLY-5638) "Buffer was already freed" error from http request processing
by Arto Huusko (JIRA)
[ https://issues.jboss.org/browse/WFLY-5638?page=com.atlassian.jira.plugin.... ]
Arto Huusko commented on WFLY-5638:
-----------------------------------
I will try to test newer WildFly at some point, but it won't be very easy wrt. our product.
If there is a git commit that fixes this, or if the fix is in newer undertow 1.2 series, it would be easier to run patch wildfly 9.0.1 with the fix?
Can you confirm if this error can cause a socket leak? We are in the process of deploying our product on wildfly 9.0.1 fairly soon, and upgrading wildfly version at this point is not an option.
> "Buffer was already freed" error from http request processing
> -------------------------------------------------------------
>
> Key: WFLY-5638
> URL: https://issues.jboss.org/browse/WFLY-5638
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 9.0.1.Final
> Reporter: Arto Huusko
> Assignee: Stuart Douglas
> Attachments: stacktrace.txt
>
>
> Undertow causes XNIO exception "Buffer was already freed" during response write, possibly due to premature client close.
> I suspect this may also cause the socket to leak, because the number of "Buffer was already freed" messages in widlfly server.log corresponds to the number of leaked sockets in the lsof command output for the wildfly process (seen as sockets with "can't identify protocol" description).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months