[Bug 66338] New: ErrorReportValve.report no longer called for all errors

2022-11-04 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66338

Bug ID: 66338
   Summary: ErrorReportValve.report no longer called for all
errors
   Product: Tomcat 9
   Version: 9.0.67
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: snuga...@gmail.com
  Target Milestone: -

Up to and including tomcat 9.0.65, the report method of ErrorReportValve was
invoked for all requests, and subclasses could then decide on the exact
conditions when to report an error. The logic at the start of the report method
of ErrorReportValve and JsonErrorReportValve was identical, so it was
refactored into  the invoke method of ErrorReportValve in 9.0.67.
However, this changes the behavior of all custom subclasses of ErrorReportValve
- their report method now only gets called if the response is explitcitly
marked as error. The report method no longer gets called for responses with
status code >= 400, but without a Throwable. There is no way to customize this
behavior without copy-pasting the whole invoke method.
It would be nice if the deduplicated code was not directly a part of the invoke
method, but in a separate protected method that could be overridden by
subclasses.

-- 
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



[tomcat] branch main updated: Add a simple Loom based Executor

2022-11-04 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new fa352e4ed2 Add a simple Loom based Executor
fa352e4ed2 is described below

commit fa352e4ed20a58783dfc10f205d2e17fa690554d
Author: Mark Thomas 
AuthorDate: Thu Oct 20 14:27:13 2022 +0100

Add a simple Loom based Executor
---
 .../org/apache/catalina/core/LoomExecutor.java | 68 ++
 1 file changed, 68 insertions(+)

diff --git 
a/modules/loom/src/main/java/org/apache/catalina/core/LoomExecutor.java 
b/modules/loom/src/main/java/org/apache/catalina/core/LoomExecutor.java
new file mode 100644
index 00..d4ae23b021
--- /dev/null
+++ b/modules/loom/src/main/java/org/apache/catalina/core/LoomExecutor.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import org.apache.catalina.Executor;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.util.LifecycleMBeanBase;
+
+/**
+ * An executor that uses a new virtual thread for each task.
+ */
+public class LoomExecutor extends LifecycleMBeanBase implements Executor {
+
+private String name;
+private Thread.Builder threadBuilder;
+
+public void setName(String name) {
+this.name = name;
+}
+
+@Override
+public String getName() {
+return name;
+}
+
+@Override
+public void execute(Runnable command) {
+threadBuilder.start(command);
+}
+
+@Override
+protected void startInternal() throws LifecycleException {
+threadBuilder = Thread.ofVirtual().name(getName() + "-", 0);
+setState(LifecycleState.STARTING);
+}
+
+@Override
+protected void stopInternal() throws LifecycleException {
+threadBuilder = null;
+setState(LifecycleState.STOPPING);
+}
+
+@Override
+protected String getDomainInternal() {
+// No way to navigate to Engine. Needs to have domain set.
+return null;
+}
+
+@Override
+protected String getObjectNameKeyProperties() {
+return "type=Executor,name=" + getName();
+}
+}


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Apache Tomcat migration tool for Jakarta EE 1.0.5

2022-11-04 Thread Rémy Maucherat
On Wed, Nov 2, 2022 at 1:43 PM Mark Thomas  wrote:
>
> The proposed Apache Tomcat migration tool for Jakarta EE 1.0.5 is now
> available for voting.
>
> The significant changes since 1.0.4 are:
>
> - #37 narrow scope of javax.annotation conversion to Java EE. PR by
>Danny Thomas
> - #36 Improve manifest handling and conversion performance. PR by Danny
>Thomas.
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/jakartaee-migration/v1.0.5/
>
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1404/
>
> The tag is:
> https://github.com/apache/tomcat-jakartaee-migration/tree/1.0.5
> d87e1ec7e67c8d61340111b796e3bb8179a6f0ba
>
> The proposed 1.0.5 release is:
>
> [ ] -1: Broken. Do not release because...
> [X] +1: Acceptable. Go ahead and release.

Rémy

> Thanks,
>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat Native 2.0.2

2022-11-04 Thread Rémy Maucherat
On Wed, Nov 2, 2022 at 9:57 PM Mark Thomas  wrote:
>
> The key differences of version 2.0.2 compared to 2.0.1 are:
>
> - Update the minimum supported version of LibreSSL to 3.5.2.
>Based on a #13 provided by orbea.
>
> - The windows binaries in this release have been built with OpenSSL
>3.0.7
>
> The 2.0.x branch is primarily intended for use with Tomcat 10.1.x but
> can be used with earlier versions as long as the APR/native connector is
> not used.
>
> The proposed release artefacts can be found at [1],
> and the build was done using tag [2].
>
> The Apache Tomcat Native 2.0.2 release is
>   [X] Stable, go ahead and release
>   [ ] Broken because of ...
>
> Thanks,
>
> Mark

Rémy

> [1]
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/native/2.0.2
> [2]
> https://gitbox.apache.org/repos/asf?p=tomcat-native.git;a=commit;h=9fea6f69aca11c2a129c557934f9abb40ac4e732
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66338] ErrorReportValve.report no longer called for all errors

2022-11-04 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66338

--- Comment #1 from Remy Maucherat  ---
I agree this is an important nuance. Given this refactoring is not exactly
super critical, I propose simply reverting it.

-- 
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: [VOTE] Release Apache Tomcat Native 2.0.2

2022-11-04 Thread Mark Thomas

On 02/11/2022 20:57, Mark Thomas wrote:


The Apache Tomcat Native 2.0.2 release is
  [X] Stable, go ahead and release
  [ ] Broken because of ...


Tested using Tomcat 11 unit tests.

Tested on Windows and Linux with 2.0.2 and OpenSSL 3.0.7.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Apache Tomcat migration tool for Jakarta EE 1.0.5

2022-11-04 Thread Mark Thomas

On 02/11/2022 12:43, Mark Thomas wrote:

The proposed 1.0.5 release is:

[ ] -1: Broken. Do not release because...
[X] +1: Acceptable. Go ahead and release.


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56026] RemoteEndpoint.Async#sendText(String, SendHandler) not thread safe

2022-11-04 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=56026

--- Comment #20 from Jonathan Leech  ---
(In reply to Mark Thomas from comment #19)
> (In reply to Jonathan Leech from comment #18)
> > I'll try again here. The current Tomcat implementation of this API throws
> > IllegalStateException / TEXT_FULL_WRITING even if the client synchronizes
> > access to the methods and / or ensures that the last message was delivered
> > (as far as the async API is concerned) before sending the next message.
> 
> To clarify, do you mean the call to Async.sendText() has returned or do you
> mean that the Future / completion handler has indicated that the sending of
> the message is complete?
> 
> > Repeatedly saying for 8 years you're following the spec and to take it up
> > with the expert group is not helpful. This is a bug. The sync calls
> > shouldn't return and the async calls shouldn't represent that the message
> > was completed if a subsequent call would result in TEXT_FULL_WRITING.
> 
> There are simple ways forward here but which one depends on the answer to
> the above question.

The Future / completion handler has indicated that the sending of the message
is complete.

-- 
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