ASF GitHub Bot commented on KAFKA-4472:

GitHub user kichristensen opened a pull request:


    KAFKA-4472: offsetRetentionMs miscalculated in GroupCoordinator

    Fix possible integer overflow

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kichristensen/kafka 

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2200
commit e0ea8736d104d68f3d2969edef485592b3aaf320
Author: Kim Christensen <k...@mvno.dk>
Date:   2016-12-01T23:11:30Z

    Fix possible overflow


> offsetRetentionMs miscalculated in GroupCoordinator
> ---------------------------------------------------
>                 Key: KAFKA-4472
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4472
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions:,
>            Reporter: Jason Aliyetti
>            Assignee: Kim Christensen
> The configuration "offsets.retention.minutes" is documented as being an 
> integer.  When large values are set (i.e. Integer.MAX_VALUE), an overflow 
> error occurs when converting from minutes to milliseconds.  For instance, 
> setting the config value as 2147483647 results in a offsetsRetentionMs of 
> -60000.  This means that all committed offsets are past their expiration when 
> they are created and will be nullified on the next expiration check, which is 
> unexpected given the type of the configuration.
> The fix would be to change
> "offsetsRetentionMs = config.offsetsRetentionMinutes * 60 * 1000L"
> to
> "offsetsRetentionMs = config.offsetsRetentionMinutes * 60L * 1000L"
> in GroupCoordinator.apply().

This message was sent by Atlassian JIRA

Reply via email to