Giter Site home page Giter Site logo

Add support for Virtual Threads about logback HOT 9 CLOSED

ceki avatar ceki commented on August 18, 2024 2
Add support for Virtual Threads

from logback.

Comments (9)

ceki avatar ceki commented on August 18, 2024 2

@mgocd The issue is unrelated to JIGSAW modularization but accessing a package private inner class via reflection. The IllegalAccessException issue has been fixed in logback 1.5.0.

from logback.

ceki avatar ceki commented on August 18, 2024 1

See commits 9a1fc44 and f6d690d

from logback.

wupei93 avatar wupei93 commented on August 18, 2024 1

hi @ceki, How can I enable this virtual thread feature? Are there some documents?

from logback.

ceki avatar ceki commented on August 18, 2024 1

@johncurrier Indeed, the switch is automatic when running under Java 21.

The System.out.println() issue existed in 1.3.12/14.12 released on 2023-12-27 and was fixed a in version 1.3.13/1.4.13 released a day later. Are you observing otherwise?

from logback.

johncurrier avatar johncurrier commented on August 18, 2024

@wupei93 it looks like it switches automatically when running under Java 21. The code by @ceki, however, seems to still contain System.out.println()s, so I'm guessing it's not quite ready.

from logback.

fatemeh-saf avatar fatemeh-saf commented on August 18, 2024

I'm using logback 1.3.11 in my scala code (which is compiled by java 8) and just upgraded to logback 1.3.12. sbt compile failed with bad constant pool index error and failed. compiler version is 2.13.10
Is there any dependency updates in 1.3.12 that could cause this?

from logback.

mgocd avatar mgocd commented on August 18, 2024

In JDK 21.0.1 and 21.0.2 (tested on Eclipse Temurin distribution, without any -add-opens flags) the code added in 9a1fc44 (ExecutorServiceUtil#makeThreadFactory) fails with the following error:

java.lang.IllegalAccessException: class ch.qos.logback.core.util.ExecutorServiceUtil$1 
cannot access a member of class java.lang.ThreadBuilders$VirtualThreadBuilder (in module java.base)
with modifiers "public"

and the DefaultThreadFactory is used.

from logback.

ceki avatar ceki commented on August 18, 2024

@mgocd In a JIGSAW modular application the IllegalAccessException is thrown but caught and Executors.defaultThreadFactory() is used. Would you concur?

from logback.

mgocd avatar mgocd commented on August 18, 2024

@ceki Yes it's thrown, caught and Executors.defaultThreadFactory() is used, but I observed it in a standard non-modularized Spring Boot app, please see a minimal reproduction here: https://github.com/mgocd/logback-virtualthreads

from logback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.