Re: AsyncContext.dispatch(path) invoked more than once
2013/5/29 Violeta Georgieva wrote: > > 2013/5/28 Konstantin Kolinko wrote: > > > > > > I think that your patch is wrong. > > > > Looking at how ActionCode.ASYNC_DISPATCH is handled in different > > connector implementations in Tomcat 7, the code is like the following: > > > > if (asyncStateMachine.asyncDispatch()) { > > ((AprEndpoint)endpoint).processSocketAsync(this.socket, > > SocketStatus.OPEN); > > } > > > > In your example dispatching does not happen immediately as > > asyncDispatch() call returns "false" and asyncStateMachine state > > changes to AsyncState.MUST_DISPATCH. Thus your patch works. > > > > But, there is a case when the call returns "true" and dispatching > > happens immediately. Such dispatching will be broken. > > Thanks for pointing this. > > > > > BTW, I wonder if the following can be an alternative: > > > > if (this.dispatch != null) throw new IllegalStateException(".."); > > Unfortunately this will break another scenario: > > Servlet1 does dispatch to Servlet2 > > AsyncContext asyncContext = request.startAsync(request, response); > asyncContext .dispatch("/Servlet2"); > > Servlet2 does dispatch to resourceA > > AsyncContext asyncContext = request.startAsync(request, response); > asyncContext .dispatch("/Servlet2"); < here we still do not have invocation to AsyncContextImpl.recycle and AsyncContextImpl.dispatch field is not null > > > So if we introduce a null check we will break double dispatch scenario. > > The solution might be to separate the check for state and the actual action invocation. Let's put this as plan B for now. I made a small change in the AsyncContextImpl.doInternalDispatch(). Can you comment on the patch? Index: C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java === --- C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java (revision 1488110) +++ C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java (working copy) @@ -185,6 +185,10 @@ logDebug("dispatch "); } check(); +if (dispatch != null) { +throw new IllegalStateException( +sm.getString("asyncContextImpl.dispatchingStarted")); +} if (request.getAttribute(ASYNC_REQUEST_URI)==null) { request.setAttribute(ASYNC_REQUEST_URI, request.getRequestURI()); request.setAttribute(ASYNC_CONTEXT_PATH, request.getContextPath()); @@ -347,7 +351,9 @@ logDebug("intDispatch"); } try { -dispatch.run(); +Runnable runnable = dispatch; +dispatch = null; +runnable.run(); if (!request.isAsync()) { fireOnComplete(); } > Wdyt? > > Violeta > > > > > Best regards, > > Konstantin Kolinko > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: dev-h...@tomcat.apache.org > > >
Re: svn commit: r1487993 - /tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java
On 31/05/2013 06:36, Rainer Jung wrote: > On 30.05.2013 22:15, ma...@apache.org wrote: >> Author: markt >> Date: Thu May 30 20:15:15 2013 >> New Revision: 1487993 >> >> URL: http://svn.apache.org/r1487993 >> Log: >> Finally figured out how t get multicast working locally on my mac. Document >> it. >> >> Modified: >> tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >> >> Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >> URL: >> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java?rev=1487993&r1=1487992&r2=1487993&view=diff >> == >> --- tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >> (original) >> +++ tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Thu >> May 30 20:15:15 2013 >> @@ -24,6 +24,23 @@ import java.net.UnknownHostException; >> /** >> * A simple multicast test that replicates the core elements of Tomcat's >> * multicast membership. If this works then multicast membership should >> work. >> + * Useful notes for various operating systems follow. >> + * OSX >> + * >> + * Multicast is not routed by default. >> + * Check if multicast is routed by looking at the routing table via >> + * netstat -nr. If there is no line the output for >> 228.0.0.4 >> + * then multicast will not work. >> + * Add a route for multicast using >> + * sudo route -nv add -net 228.0.0.4 -interface en0 >> + * The firewall blocks multicast bewteen processes on the local machine >> so >> + * you will need to disable the OSX forewall before the test below will >> + * work. >> + * > > Shouldn't the multicast route be for network 224.0.0.0 with netmask > 240.0.0.0? For the general case. > I think the above is just an example multicast address and typical > system will not have a route for that one, but could and should have a > route for multicast in general (224.0.0.0/240.0.0.0). OSX doesn't have any multicast routes present by default. The notes could certainly be amended to reflect the more general case. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1487993 - /tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java
2013/5/31 Mark Thomas : > On 31/05/2013 06:36, Rainer Jung wrote: >> On 30.05.2013 22:15, ma...@apache.org wrote: >>> Author: markt >>> Date: Thu May 30 20:15:15 2013 >>> New Revision: 1487993 >>> >>> URL: http://svn.apache.org/r1487993 >>> Log: >>> Finally figured out how t get multicast working locally on my mac. Document >>> it. >>> >>> Modified: >>> tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >>> >>> Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >>> URL: >>> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java?rev=1487993&r1=1487992&r2=1487993&view=diff >>> == >>> --- tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java >>> (original) >>> +++ tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Thu >>> May 30 20:15:15 2013 >>> @@ -24,6 +24,23 @@ import java.net.UnknownHostException; >>> /** >>> * A simple multicast test that replicates the core elements of Tomcat's >>> * multicast membership. If this works then multicast membership should >>> work. >>> + * Useful notes for various operating systems follow. >>> + * OSX >>> + * >>> + * Multicast is not routed by default. >>> + * Check if multicast is routed by looking at the routing table via >>> + * netstat -nr. If there is no line the output for >>> 228.0.0.4 >>> + * then multicast will not work. >>> + * Add a route for multicast using >>> + * sudo route -nv add -net 228.0.0.4 -interface en0 >>> + * The firewall blocks multicast bewteen processes on the local >>> machine so >>> + * you will need to disable the OSX forewall before the test below will >>> + * work. >>> + * >> >> Shouldn't the multicast route be for network 224.0.0.0 with netmask >> 240.0.0.0? > > For the general case. > >> I think the above is just an example multicast address and typical >> system will not have a route for that one, but could and should have a >> route for multicast in general (224.0.0.0/240.0.0.0). > > OSX doesn't have any multicast routes present by default. The notes > could certainly be amended to reflect the more general case. > Maybe add this to the "(7) Tests" section of BUILDING.txt? At least a brief "see TesterMulticast.java". This class is not part of active testsuite though. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: CORS Filter
On 30/05/2013 22:06, Jason Brittain wrote: > Thoughts? Create an enhancement request in Bugzilla. I note that there was a request for this a few months ago on the users list. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488139 - /tomcat/trunk/BUILDING.txt
Author: markt Date: Fri May 31 10:12:57 2013 New Revision: 1488139 URL: http://svn.apache.org/r1488139 Log: Add note on testing multicast Modified: tomcat/trunk/BUILDING.txt Modified: tomcat/trunk/BUILDING.txt URL: http://svn.apache.org/viewvc/tomcat/trunk/BUILDING.txt?rev=1488139&r1=1488138&r2=1488139&view=diff == --- tomcat/trunk/BUILDING.txt (original) +++ tomcat/trunk/BUILDING.txt Fri May 31 10:12:57 2013 @@ -293,7 +293,6 @@ directory: output/build/logs - By default the testsuite is run three times to test 3 different implementations of Tomcat connectors: BIO, NIO and APR. (If you are not familiar with Tomcat connectors, see config/http.html in documentation for @@ -318,6 +317,12 @@ If you are on Windows and want to test t tcnative-1.dll file into ${tomcat.source}/bin/native/ and it will be copied into the above directory when the build runs. +The unit tests include tests of the clustering functionality which require +multicast to be enabled. There is a simple application provided in the Tomcat +test source (org.apache.catalina.tribes.TesterMulticast) that can be used to +check if a machine supports multicast. Notes on enabling multicast for different +operating systems are provided in the Javadoc for that class. + (7.2) Running a single test - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488143 - /tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java
Author: markt Date: Fri May 31 10:36:14 2013 New Revision: 1488143 URL: http://svn.apache.org/r1488143 Log: Routing table doesn't show it but it looks like firewall was the only issue. Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java?rev=1488143&r1=1488142&r2=1488143&view=diff == --- tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java (original) +++ tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Fri May 31 10:36:14 2013 @@ -27,12 +27,6 @@ import java.net.UnknownHostException; * Useful notes for various operating systems follow. * OSX * - * Multicast is not routed by default. - * Check if multicast is routed by looking at the routing table via - * netstat -nr. If there is no line the output for 228.0.0.4 - * then multicast will not work. - * Add a route for multicast using - * sudo route -nv add -net 228.0.0.4 -interface en0 * The firewall blocks multicast bewteen processes on the local machine so * you will need to disable the OSX forewall before the test below will * work. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488144 - /tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java
Author: markt Date: Fri May 31 10:36:56 2013 New Revision: 1488144 URL: http://svn.apache.org/r1488144 Log: Fix typos Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Modified: tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java?rev=1488144&r1=1488143&r2=1488144&view=diff == --- tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java (original) +++ tomcat/trunk/test/org/apache/catalina/tribes/TesterMulticast.java Fri May 31 10:36:56 2013 @@ -27,8 +27,8 @@ import java.net.UnknownHostException; * Useful notes for various operating systems follow. * OSX * - * The firewall blocks multicast bewteen processes on the local machine so - * you will need to disable the OSX forewall before the test below will + * The firewall blocks multicast between processes on the local machine so + * you will need to disable the OSX firewall before the test below will * work. * * Windows Server 2008 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488151 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
Author: kkolinko Date: Fri May 31 11:03:26 2013 New Revision: 1488151 URL: http://svn.apache.org/r1488151 Log: (Reviewing r1485114) Make antiLockingDocBase an absolute path. It is very unlikely that java.io.tmpdir is not an absolute path. For consistency, convert it to the absolute form just once, so the path used when starting and stopping the webapp is certainly the same. Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1488151&r1=1488150&r2=1488151&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri May 31 11:03:26 2013 @@ -213,7 +213,8 @@ public class ContextConfig implements Li /** - * Anti-locking docBase + * Anti-locking docBase. It is a path to a copy of the web application + * in the java.io.tmpdir directory. This path is always an absolute one. */ private File antiLockingDocBase = null; @@ -736,17 +737,18 @@ public class ContextConfig implements Li System.getProperty("java.io.tmpdir"), deploymentCount++ + "-" + docBase); } +antiLockingDocBase = antiLockingDocBase.getAbsoluteFile(); if (log.isDebugEnabled()) { log.debug("Anti locking context[" + context.getName() + "] setting docBase to " + -antiLockingDocBase.getAbsolutePath()); +antiLockingDocBase.getPath()); } // Cleanup just in case an old deployment is lying around ExpandWar.delete(antiLockingDocBase); if (ExpandWar.copy(docBaseFile, antiLockingDocBase)) { -context.setDocBase(antiLockingDocBase.getAbsolutePath()); +context.setDocBase(antiLockingDocBase.getPath()); } } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488152 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ContextConfig.java
Author: kkolinko Date: Fri May 31 11:07:18 2013 New Revision: 1488152 URL: http://svn.apache.org/r1488152 Log: Merged revision 1488151 from tomcat/trunk: (Reviewing r1485114) Make antiLockingDocBase an absolute path. It is very unlikely that java.io.tmpdir is not an absolute path. For consistency, convert it to the absolute form just once, so the path used when starting and stopping the webapp is certainly the same. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1488151 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1488152&r1=1488151&r2=1488152&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri May 31 11:07:18 2013 @@ -231,7 +231,8 @@ public class ContextConfig implements Li /** - * Anti-locking docBase + * Anti-locking docBase. It is a path to a copy of the web application + * in the java.io.tmpdir directory. This path is always an absolute one. */ private File antiLockingDocBase = null; @@ -803,16 +804,17 @@ public class ContextConfig implements Li System.getProperty("java.io.tmpdir"), deploymentCount++ + "-" + docBase); } +antiLockingDocBase = antiLockingDocBase.getAbsoluteFile(); if (log.isDebugEnabled()) log.debug("Anti locking context[" + context.getName() + "] setting docBase to " + -antiLockingDocBase.getAbsolutePath()); +antiLockingDocBase.getPath()); // Cleanup just in case an old deployment is lying around ExpandWar.delete(antiLockingDocBase); if (ExpandWar.copy(docBaseFile, antiLockingDocBase)) { -context.setDocBase(antiLockingDocBase.getAbsolutePath()); +context.setDocBase(antiLockingDocBase.getPath()); } } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1488167 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: kkolinko Date: Fri May 31 11:25:16 2013 New Revision: 1488167 URL: http://svn.apache.org/r1488167 Log: Propose r1484923 for vote. Add r1488151 so the list of followup patches so that it is not forgotten. A patch file is needed. Removing votes for now. Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1488167&r1=1488166&r2=1488167&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Fri May 31 11:25:16 2013 @@ -31,11 +31,26 @@ PATCHES ACCEPTED TO BACKPORT: PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] -* Clean-up recording of location where WAR is copied when using anti-locking - features of a Context + + +* Make deletion of the copied WARs used for anti-resource locking more + robust if the context fails to start (there were some circumstances where + the original WAR could get deleted). + http://svn.apache.org/r1484923 + http://svn.apache.org/r1484924 (documentation) + Already committed in Tomcat 6. + Formally proposing for a review, see Re:r1484923 thread on dev@. + Two followup patches are below. + +1: markt, kkolinko + -1: + + Followups to r1484923: http://svn.apache.org/r1485114 - +1: markt + http://svn.apache.org/r1488151 + (markt/kkolinko) + +1: -1: + kkolinko: r1485114 does not merge cleanly. A patch file is needed. * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55019 Fix an exception that occurs when accessing certain JSP page when running - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4398 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1488144 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[Bug 55035] New: Deploy ROOT webapp with version through text manager using Ant
https://issues.apache.org/bugzilla/show_bug.cgi?id=55035 Bug ID: 55035 Summary: Deploy ROOT webapp with version through text manager using Ant Product: Tomcat 7 Version: 7.0.40 Hardware: PC OS: All Status: NEW Severity: major Priority: P2 Component: Manager Assignee: dev@tomcat.apache.org Reporter: sergey...@gmail.com Currently Ant "deploy" task does not support separate parameter "version" and, thanks to URLEncoder, there is no workaround for that. But for apps with not empty context it's possible to define version using ##, like setting path to "/someContext#someVersion". For apps with empty context we receive error: Case #1: Result: Failed to deploy application at context path /ROOT##12345 Case #1: Result: Failed to deploy application at context path /##12345 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Request for wiki update permission
I have just registered a wiki name of BrianBurch. Could I please be given permission to update the tomcat wiki? (I need to bring the page on NetBeans support up to date with http://svn.apache.org/r1484409) Thanks, Brian - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Tomcat Wiki] Update of "ContributorsGroup" by markt
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "ContributorsGroup" page has been changed by markt: https://wiki.apache.org/tomcat/ContributorsGroup?action=diff&rev1=6&rev2=7 Comment: += BrianBurch * [Krzysztof Gil] * NevenCvetkovic * ShawnYu + * BrianBurch - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Request for wiki update permission
On 31/05/2013 17:32, Brian Burch wrote: > I have just registered a wiki name of BrianBurch. Could I please be > given permission to update the tomcat wiki? (I need to bring the page on > NetBeans support up to date with http://svn.apache.org/r1484409) Done. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
APR/native errors with non-blocking I/O
I'm consistently seeing errors with APR/native and TestNonBlockingAPI.testNonBlockingWrite This works on Windows but fails on Linux and OSX. Failures always occur with Socket.sendbb(socket, offset, long) The sequence of events is: ~100 successful writes (9000 bytes at a time) write returns 120002 (EAGAIN) add socket to poller poller indicates socket is available for write ~80 successful writes (mostly 9000 bytes at a time but the odd 2 bytes and some ~500) write returns 120002 (EAGAIN) add socket to poller poller indicates socket is available for write one write write returns error code On OSX the error code is -32 On Linux the error code is -104 I could really do with some hints here. I've been debugging this for days. I've found and fixed various problems but this underlying problem remains. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
RE: APR/native errors with non-blocking I/O
> From: Mark Thomas [mailto:ma...@apache.org] > Subject: APR/native errors with non-blocking I/O Assuming these are negative errno values: > On OSX the error code is -32 Broken pipe. > On Linux the error code is -104 Connection reset by peer. Did the other end go away? Can you get a packet capture from both one end or the other? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
RE: APR/native errors with non-blocking I/O
"Caldarale, Charles R" wrote: >> From: Mark Thomas [mailto:ma...@apache.org] >> Subject: APR/native errors with non-blocking I/O > >Assuming these are negative errno values: > >> On OSX the error code is -32 > >Broken pipe. > >> On Linux the error code is -104 > >Connection reset by peer. > >Did the other end go away? > >Can you get a packet capture from both one end or the other? Thanks Chuck. Very helpful. The other end does hang up but it wasn't clear if that was the root cause or the result. The client reports invalid chunked encoding. I'll look into the client code. Where might I find a list of these error codes. My Google fu let me down. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
RE: APR/native errors with non-blocking I/O
> From: Mark Thomas [mailto:ma...@apache.org] > Subject: RE: APR/native errors with non-blocking I/O > Where might I find a list of these error codes. It's a bit old, but still pretty accurate: http://www.ioplex.com/~miallen/errcmpp.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: APR/native errors with non-blocking I/O
On 31.05.2013 21:34, Mark Thomas wrote: > "Caldarale, Charles R" wrote: > >>> From: Mark Thomas [mailto:ma...@apache.org] >>> Subject: APR/native errors with non-blocking I/O >> >> Assuming these are negative errno values: >> >>> On OSX the error code is -32 >> >> Broken pipe. >> >>> On Linux the error code is -104 >> >> Connection reset by peer. >> >> Did the other end go away? >> >> Can you get a packet capture from both one end or the other? > > Thanks Chuck. Very helpful. > > The other end does hang up but it wasn't clear if that was the root cause or > the result. The client reports invalid chunked encoding. I'll look into the > client code. > > Where might I find a list of these error codes. My Google fu let me down. First: the real numbers are the positive ones, so multiply all with -1. The errno numbers are defined in /usr/include/errno.h and /usr/include/sys/errno.h at least on Linux. Most of them are not standardized, so can vary by platform. Then there's strerror(3C) and perror(3C) (so "man strerror", "man perror"). Example: #include #include int main() { int n; while(1) { printf("Enter errno: "); scanf("%d", &n); printf("Error string for errno %d is: %s\n", n, strerror(n)); } } Compile and have fun. IMHO we don't have that in the code to output text instead of cryptic numbers because it isn't really available on all needed platforms. I could be wrong though. Regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
RE: APR/native errors with non-blocking I/O
> From: Rainer Jung [mailto:rainer.j...@kippdata.de] > Subject: Re: APR/native errors with non-blocking I/O > Compile and have fun. Or we could talk about Mark's familiarity with C :-) > IMHO we don't have that in the code to output text instead of cryptic > numbers because it isn't really available on all needed platforms. I > could be wrong though. The strerror() API is part of the POSIX and C standards, so it should be there unless you're running on some cut-down embedded platform. However, it is not thread-safe, so it might not be appropriate to include it in JNI code. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: APR/native errors with non-blocking I/O
Rainer, On 5/31/13 4:35 PM, Rainer Jung wrote: > On 31.05.2013 21:34, Mark Thomas wrote: >> "Caldarale, Charles R" wrote: >> From: Mark Thomas [mailto:ma...@apache.org] Subject: APR/native errors with non-blocking I/O >>> >>> Assuming these are negative errno values: >>> On OSX the error code is -32 >>> >>> Broken pipe. >>> On Linux the error code is -104 >>> >>> Connection reset by peer. >>> >>> Did the other end go away? >>> >>> Can you get a packet capture from both one end or the other? >> >> Thanks Chuck. Very helpful. >> >> The other end does hang up but it wasn't clear if that was the root cause or >> the result. The client reports invalid chunked encoding. I'll look into the >> client code. >> >> Where might I find a list of these error codes. My Google fu let me down. > > First: the real numbers are the positive ones, so multiply all with -1. > > The errno numbers are defined in > > /usr/include/errno.h > > and > > /usr/include/sys/errno.h > > at least on Linux. Most of them are not standardized, so can vary by > platform. > > Then there's strerror(3C) and perror(3C) (so "man strerror", "man perror"). > > Example: > > #include > #include > int main() { > int n; > while(1) { > printf("Enter errno: "); > scanf("%d", &n); > printf("Error string for errno %d is: %s\n", >n, strerror(n)); > } > } > > Compile and have fun. > > IMHO we don't have that in the code to output text instead of cryptic > numbers because it isn't really available on all needed platforms. I > could be wrong though. From the (Mac OS) man page: "The perror() and strerror() functions conform to ISO/IEC 9899:1999 (``ISO C99'')". Can we bet on C99? Or we could create a macro that uses strerror() when available or just returns the error code as a string when not available. -chris signature.asc Description: OpenPGP digital signature
Re: APR/native errors with non-blocking I/O
Chuck, On 5/31/13 4:42 PM, Caldarale, Charles R wrote: >> From: Rainer Jung [mailto:rainer.j...@kippdata.de] >> Subject: Re: APR/native errors with non-blocking I/O > >> Compile and have fun. > > Or we could talk about Mark's familiarity with C :-) > >> IMHO we don't have that in the code to output text instead of cryptic >> numbers because it isn't really available on all needed platforms. I >> could be wrong though. > > The strerror() API is part of the POSIX and C standards, so it should > be there unless you're running on some cut-down embedded platform. > However, it is not thread-safe, so it might not be appropriate to > include it in JNI code. I'm pretty sure that sterror is thread safe: it should just return a static char*. The GNU man page for strerror() says that strerror_r is just like strerror(), "but is thread safe". It doesn't specifically say that strerror() is *not* thread-safe, but does imply it. On my Mac, there is no mention of thread safety at all on that man page (except this: "For unknown error numbers, the strerror() function will return its result in a static buffer which may be overwritten by subsequent calls." Hopefully, that means static and private to the thread, but I don't know.) Back to the GNU man page, it says: "strerror() is specified by POSIX.1-2001, C89, C99. strerror_r() is specified by POSIX.1-2001.", so we may be able to rely upon it. -chris signature.asc Description: OpenPGP digital signature
Re: APR/native errors with non-blocking I/O
On 31/05/2013 21:42, Caldarale, Charles R wrote: >> From: Rainer Jung [mailto:rainer.j...@kippdata.de] >> Subject: Re: APR/native errors with non-blocking I/O > >> Compile and have fun. > > Or we could talk about Mark's familiarity with C :-) That will be an extremely short conversation ;) >> IMHO we don't have that in the code to output text instead of cryptic >> numbers because it isn't really available on all needed platforms. I >> could be wrong though. > > The strerror() API is part of the POSIX and C standards, so it should be > there unless you're running on some cut-down embedded platform. However, it > is not thread-safe, so it might not be appropriate to include it in JNI code. If possible that would be a help. On the other hand, I wouldn't have fixed all the other problems in the non-blocking code if it hadn't been for not realising these were pointing me at the client. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55035] Deploy ROOT webapp with version through text manager using Ant
https://issues.apache.org/bugzilla/show_bug.cgi?id=55035 Sergey Tcherednichenko changed: What|Removed |Added CC||sergey...@gmail.com --- Comment #1 from Sergey Tcherednichenko --- Created attachment 30353 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30353&action=edit Ant "deploy" task should also take "version" as a parameter, and can extend AbstractCatalinaCommandTask This patch makes DeployTask to extend AbstractCatalinaCommandTask, so path and version parameters are set uniformly ("version" parameter was missing in the deploy task, and usage like ${context}##{version} did not work fine for the root context). -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55035] Deploy ROOT webapp with version through text manager using Ant
https://issues.apache.org/bugzilla/show_bug.cgi?id=55035 Sergey Tcherednichenko changed: What|Removed |Added Version|7.0.40 |7.0.37 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
RE: APR/native errors with non-blocking I/O
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: APR/native errors with non-blocking I/O > I'm pretty sure that sterror is thread safe: it should just return a > static char*. Would that it were that simple. Seriously, it's not thread safe; a second thread calling the API can overlay a prior thread's message. If it were thread safe, GNU wouldn't have bothered with the _r alternative. > "For unknown error numbers, the strerror() function will return its > result in a static buffer which may be overwritten by subsequent calls." > Hopefully, that means static and private to the thread, but I don't know. Nope, it's static and global. > Back to the GNU man page, it says: "strerror() is specified by > POSIX.1-2001, C89, C99. strerror_r() is specified by POSIX.1-2001.", so > we may be able to rely upon it. Yes, the _r alternative is available on many (probably most, these days) platforms, but it's by no means universal. (On another mailing list, we had someone still trying to use gcc 3.3...) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org