GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AdaptiveByteBufAllocator.newDirectBuffer throws BlockingOperationError · Issue #14560 · netty/netty

AdaptiveByteBufAllocator.newDirectBuffer throws BlockingOperationError #14560

New issue
Copy link
New issue
Copy link
Closed
#14564
Closed
AdaptiveByteBufAllocator.newDirectBuffer throws BlockingOperationError#14560
#14564
Copy link

Description

@violetagg
violetagg
opened on Dec 12, 2024
Issue body actions

Expected behavior

AdaptiveByteBufAllocator.newDirectBuffer does not throw AdaptiveByteBufAllocator.newDirectBuffer

Actual behavior

AdaptiveByteBufAllocator.newDirectBuffer throws AdaptiveByteBufAllocator.newDirectBuffer

Caused by: reactor.blockhound.BlockingOperationError: Blocking call! sun.misc.Unsafe#park
	at sun.misc.Unsafe.park(Unsafe.java)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
	at java.util.concurrent.CopyOnWriteArrayList.addIfAbsent(CopyOnWriteArrayList.java:624)
	at java.util.concurrent.CopyOnWriteArrayList.addIfAbsent(CopyOnWriteArrayList.java:615)
	at java.util.concurrent.CopyOnWriteArraySet.add(CopyOnWriteArraySet.java:261)
	at io.netty.buffer.AdaptivePoolingAllocator$1.initialValue(AdaptivePoolingAllocator.java:162)
	at io.netty.util.concurrent.FastThreadLocal.initialize(FastThreadLocal.java:177)
	at io.netty.util.concurrent.FastThreadLocal.get(FastThreadLocal.java:142)
	at io.netty.buffer.AdaptivePoolingAllocator.allocate(AdaptivePoolingAllocator.java:220)
	at io.netty.buffer.AdaptivePoolingAllocator.allocate(AdaptivePoolingAllocator.java:212)
	at io.netty.buffer.AdaptiveByteBufAllocator.newDirectBuffer(AdaptiveByteBufAllocator.java:70)
	at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
	at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
	at io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:116)
	at io.netty.handler.codec.http.HttpObjectEncoder.encodeFullHttpMessage(HttpObjectEncoder.java:328)
	at io.netty.handler.codec.http.HttpObjectEncoder.encode(HttpObjectEncoder.java:165)
	at io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(HttpClientCodec.java:290)
	at io.netty.handler.codec.http.HttpObjectEncoder.write(HttpObjectEncoder.java:100)
	... 58 common frames omitted

Netty version

4.2.0.Final-SNAPSHOT

JVM version (e.g. java -version)

JDK 8

OS version (e.g. uname -a)

Mac OS

Activity

  1. violetagg commented on Dec 12, 2024

    @violetagg
    violetagg
    on Dec 12, 2024
    MemberAuthor
    More actions

    Allowing the blocking call will solve the issue:

    diff --git a/common/src/main/java/io/netty/util/internal/Hidden.java b/common/src/main/java/io/netty/util/internal/Hidden.java
    index 746e91c8fa..64bd5701e7 100644
    --- a/common/src/main/java/io/netty/util/internal/Hidden.java
    +++ b/common/src/main/java/io/netty/util/internal/Hidden.java
    @@ -94,6 +94,11 @@ class Hidden {
                         "free"
                 );
     
    +            builder.allowBlockingCallsInside(
    +                    "io.netty.buffer.AdaptiveByteBufAllocator",
    +                    "allocate"
    +            );
    +
                 builder.allowBlockingCallsInside(
                         "io.netty.handler.ssl.SslHandler",
                         "handshake"
    
  2. normanmaurer commented on Dec 12, 2024

    @normanmaurer
    normanmaurer
    on Dec 12, 2024
    Member
    More actions

    @violetagg can you do a PR ? This should also go into 4.1

    Reacted by Violeta Georgieva
  3. violetagg commented on Dec 12, 2024

    @violetagg
    violetagg
    on Dec 12, 2024
    MemberAuthor
    More actions

    @violetagg can you do a PR ? This should also go into 4.1

    ok, will do that

  4. normanmaurer
    closed this as completedin #14564on Dec 13, 2024
  5. normanmaurer
    added 3 commits that reference this issue on Dec 13, 2024

    Add BlockHound exceptions for AdaptivePoolingAllocator (#14564)

    This issue will close once commit 9ef2934 is merged into the '4.2' branch.
    9ef2934

    Add BlockHound exceptions for AdaptivePoolingAllocator (#14564)

    This issue will close once commit 55343e2 is merged into the '4.2' branch.
    55343e2

    Add BlockHound exceptions for AdaptivePoolingAllocator (#14564) (#14576)

    This issue will close once commit f52ae6a is merged into the '4.2' branch.
    f52ae6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.