activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1474) TimedBuffer need sleep error detection measured against the expected timeout
Date Fri, 20 Oct 2017 14:17:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-1474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212689#comment-16212689
] 

ASF GitHub Bot commented on ARTEMIS-1474:
-----------------------------------------

Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1602#discussion_r145974574
  
    --- Diff: artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
---
    @@ -34,6 +34,25 @@
     import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
     
     public final class TimedBuffer {
    +
    +   /**
    +    * Property name to set the percentage of error allowed while expiring the flush {@code
timeout} to happen:
    +    * it can assume any positive value from {@code 0} to {@link Integer#MAX_VALUE}.
    +    * <p>
    +    * By default it is {@link #DEFAULT_TIMEOUT_ERROR_PERCENTAGE} more than the configured
{@code timeout}.
    +    */
    +   public static final String JOURNAL_TIMEOUT_ERROR_PROPERTY_NAME = "journal.timeout.error";
    +   public static final int DEFAULT_TIMEOUT_ERROR_PERCENTAGE = 50;
    +   private static final double MAX_TIMEOUT_ERROR;
    +
    +   static {
    +      final int errorPercentage = Integer.getInteger(JOURNAL_TIMEOUT_ERROR_PROPERTY_NAME,
DEFAULT_TIMEOUT_ERROR_PERCENTAGE);
    +      if (errorPercentage < 0) {
    +         throw new RuntimeException("The sleep error percentage must be >= 0");
    +      }
    +      MAX_TIMEOUT_ERROR = 1 + (errorPercentage / 100);
    --- End diff --
    
    @franz1981 ok, what is the point of this PR? to have a parameterized parameter to tweak
about? 
    
    I don't want that kind of property open... users can do weird things and then we have
to support it.. so.. keep it a constant here.... this is about making sure sleep is working
or not.
    
    
    on which case, the semantic will be same as before.. so I'm not understanding what is
the point of the change?


> TimedBuffer need sleep error detection measured against the expected timeout
> ----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1474
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1474
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Minor
>
> The current TimedBuffer implementation evaluate the sleep accuracy measuring the error
against the elapsed sleep time while the original version was using the error related to the
overall expected timeout: It would be better due to the sleep/parkNanos behaviour to maintain
the original evaluation method, but using the improved discounted (with the last flush time)
sleep time in order to not exeeding to delay flushes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message