Skip to content

Bug in analytics-sample, BlockingFlush, "Attempt to register more than 65535 parties for java.util.concurrent.Phaser" #261

@CraigStuntzWillowTree

Description

@CraigStuntzWillowTree

In the analytics-sample code there is a BlockingFlush plugin which uses java.util.concurrent.Phaser incorrectly.

The problem is if you actually try to use this in a production scenario it calls phaser.register() lots of times, but it never calls phaser.arriveAndDeregister(). Instead it calls phaser.arrive(). So after some time you will receive:

java.lang.IllegalStateException: Attempt to register more than 65535 parties for java.util.concurrent.Phaser@6cb672ad[phase = 0 parties = 65535 arrived = 65534]

I can't see how the BlockingFlush can work at all as-is. I think it needs to call phaser.arriveAndDeregister() instead?

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