Use of locks in JNDIRealm

2022-07-30 Thread Felix Schumacher

Hi all,

yesterday, we had a Tomcat, that would be unresponsive for about twenty 
minutes on every full hour. The cause was a long running scheduled job 
that used the /last/ available connection of the 200 default 
connections. All other connections were waiting to lock the single LDAP 
connection (probably waited already for a long time). I could not find a 
thread in the stack trace, that actually held the lock, so that must 
have been gone (and should probably be investigated further).


Would you mind, if we changed the locking into a timed locking and 
throwing a NamingException on timeout? That way the connections would be 
re-available in a timely manner if such a situation arises again.


Felix



OpenPGP_0xEA6C3728EA91C4AF.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


[GitHub] [tomcat-jakartaee-migration] gregorkistler opened a new issue, #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

2022-07-30 Thread GitBox


gregorkistler opened a new issue, #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29

   Hi,
   
   with the release of version 1.0.1 of the Tomcat Migration Tool for Jakarta 
EE I'm having some issues with a couple of jar files in my project which cannot 
be migrated due to an exception. Same jar(s) can be migrated using version 
1.0.0:
   
   ### jakartaee-migration-1.0.1-shaded.jar
   ```
   $ java -jar jakartaee-migration-1.0.1-shaded.jar jna-platform-4.5.1.jar 
jna-platform-4.5.1.jar.jakarta 
   Performing migration from source [/jna-platform-4.5.1.jar] to destination 
[/jna-platform-4.5.1.jar.jakarta] with Jakarta EE specification profile [TOMCAT]
   Migration starting for archive [jna-platform-4.5.1.jar] using streaming
   Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for 
entry META-INF/MANIFEST.MF: 16b8446c instead of 4535229
at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.handleSizesAndCrc(ZipArchiveOutputStream.java:718)
at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry(ZipArchiveOutputStream.java:607)
at 
org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
at 
org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:285)
at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:197)
at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:163)
at org.apache.tomcat.jakartaee.MigrationCLI.main(MigrationCLI.java:94)
Suppressed: java.io.IOException: This archive contains unclosed entries.
at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:534)
at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:1090)
at 
org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:214)
... 4 more
   ```
   
   ### jakartaee-migration-1.0.0-shaded.jar
   ```
   $ java -jar jakartaee-migration-1.0.0-shaded.jar jna-platform-4.5.1.jar 
jna-platform-4.5.1.jar.jakarta 
   Performing migration from source [/jna-platform-4.5.1.jar] to destination 
[/jna-platform-4.5.1.jar.jakarta] with Jakarta EE specification profile [TOMCAT]
   Migration starting for archive [jna-platform-4.5.1.jar] using streaming
   Migration finished for archive [jna-platform-4.5.1.jar]
   Migration completed successfully in [529] milliseconds
   ```
   
   Java version: OpenJDK 11 as well as OpenJDK 17
   OS version: Ubuntu 22.04 as well as 20.04
   
   Simple reproducer:
   1. fire up a OpenJDK Docker container, e.g. `docker run -it --rm openjdk:11 
bash`
   2. download an affected jar like [Java Native Access Platform 
4.5.1](https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar)
   3. download [Tomcat Migration Tool for Jakarta EE 
1.0.1](https://dlcdn.apache.org/tomcat/jakartaee-migration/v1.0.1/binaries/jakartaee-migration-1.0.1-shaded.jar)
   4. try to migrate the jar, e.g. `java -jar 
jakartaee-migration-1.0.1-shaded.jar jna-platform-4.5.1.jar 
jna-platform-4.5.1.jar.jakarta`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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