Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

DateHelper: locale fix #128

Open
wants to merge 43 commits into
from

Conversation

Projects
None yet
3 participants

lostdj commented Feb 1, 2014

No description provided.

shijinkui and others added some commits Nov 19, 2013

fix exception below. when the connection is closed, need not to write…
… data to response

----------
org.webbitserver.WebbitException: null on [id: 0xab10ae9c, /10.1.224.127:56076 :> /10.13.80.154:9000]
        at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
        at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:165)
        at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.nio.channels.ClosedChannelException
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:381)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:349)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
Fix for WebbitException: cannot send more responses than requests. Oc…
…curs on connection reset mid transfer (reproduces by multiple concurrent requests from client).
Merge branch 'hmottestad-webbit/master'
Webbit: Sync with upstream: Pull request "Fixed a cyclical error when flushing an error and flushing fails. #126".

Pull request details:

Added a try catch around flushResponse() in error(Throwable error) which can cause cyclical errors where one error causes another because it fails when flushing.

Following is the stack trace for the expection:

org.webbitserver.WebbitException: cannot send more responses than requests on [id: 0x4be70e4d, /10.0.0.1:57648 :> /10.0.0.99:1234]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:170)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: cannot send more responses than requests
at org.jboss.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:100)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at org.webbitserver.netty.NettyHttpResponse.write(NettyHttpResponse.java:207)
at org.webbitserver.netty.NettyHttpResponse.flushResponse(NettyHttpResponse.java:195)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:168)
... 9 more
org.webbitserver.WebbitException: cannot send more responses than requests on [id: 0x4be70e4d, /10.0.0.1:57648 :> /10.0.0.99:1234]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:170)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: cannot send more responses than requests
at org.jboss.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:100)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at org.webbitserver.netty.NettyHttpResponse.write(NettyHttpResponse.java:207)
at org.webbitserver.netty.NettyHttpResponse.flushResponse(NettyHttpResponse.java:195)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:168)
... 9 more
org.webbitserver.WebbitException: cannot send more responses than requests on [id: 0x4be70e4d, /10.0.0.1:57648 :> /10.0.0.99:1234]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:170)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: cannot send more responses than requests
at org.jboss.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:100)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at org.webbitserver.netty.NettyHttpResponse.write(NettyHttpResponse.java:207)
at org.webbitserver.netty.NettyHttpResponse.flushResponse(NettyHttpResponse.java:195)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:168)
... 9 more
org.webbitserver.WebbitException: cannot send more responses than requests on [id: 0x4be70e4d, /10.0.0.1:57648 :> /10.0.0.99:1234]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:170)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: cannot send more responses than requests
at org.jboss.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:100)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at org.webbitserver.netty.NettyHttpResponse.write(NettyHttpResponse.java:207)
at org.webbitserver.netty.NettyHttpResponse.flushResponse(NettyHttpResponse.java:195)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:168)
... 9 more
org.webbitserver.WebbitException: cannot send more responses than requests on [id: 0x4be70e4d, /10.0.0.1:57648 :> /10.0.0.99:1234]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:170)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: cannot send more responses than requests
at org.jboss.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:100)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at org.webbitserver.netty.NettyHttpResponse.write(NettyHttpResponse.java:207)
at org.webbitserver.netty.NettyHttpResponse.flushResponse(NettyHttpResponse.java:195)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:168)
... 9 more
Merge branch 'shijinkui-webbit/master'
Webbit: Sync with upstream: Alternative fix for 5e040203f055f7ece9acacf7da5a090c991606ef from this repo, taken from pull request "fix exception below. when the connection is closed, need not to write data to response #125".

Pull request details:

org.webbitserver.WebbitException: null on [id: 0xab10ae9c, /10.1.224.127:56076 :> /10.13.80.154:9000]
at org.webbitserver.WebbitException.fromException(WebbitException.java:36)
at org.webbitserver.netty.NettyHttpResponse.error(NettyHttpResponse.java:165)
at org.webbitserver.netty.NettyHttpChannelHandler$3.run(NettyHttpChannelHandler.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.nio.channels.ClosedChannelException
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:381)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:349)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
Merge branch 'upstream/master'
Conflicts:
	src/main/java/org/webbitserver/netty/NettyHttpChannelHandler.java
	src/main/java/org/webbitserver/netty/NettyHttpResponse.java
Get rid of deprecated warning during build
JUnitMatchers.containsString => CoreMatchers.containsString
Bump netty version
HttpResponse.*Header() is now deprecated, replacedwith headers().* instead.
deprecated websocket.* changed to websocketx.*
for now PostTest.request_body_longer_than_max_content_length_causes_500_and_does_not_invoke_handlers is broken, somewhy
Merge pull request #1 from Eternity-Yarr/websocketx
deprecated websocket.* changed to websocketx.*
Merge pull request #2 from Eternity-Yarr/master
Added ability to simple change listening address
Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/main/java/org/webbitserver/handler/PathMatchHandler.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment