Project

General

Profile

Actions

Bug #11330

closed

Inventory endpoint info api is reporting saturated off by one

Added by Janos Mattyasovszky over 7 years ago. Updated over 7 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Nodes & inventories
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Very Small
Priority:
49
Name check:
Fix check:
Regression:

Description

I got this back from the API endpoint while testing the inventory uploader:

{"queueMaxSize":50, "queueFillCount":49, "queueSaturated":true}

I have tested on: rudder-inventory-endpoint-4.1.5.release-1.SLES.11


Related issues 1 (0 open1 closed)

Related to Rudder - User story #9976: API endpoint to get information about queue status of uploaded inventoriesReleasedVincent MEMBRÉActions
Actions #1

Updated by Janos Mattyasovszky over 7 years ago

  • Related to User story #9976: API endpoint to get information about queue status of uploaded inventories added
Actions #2

Updated by Janos Mattyasovszky over 7 years ago

In #9976 the example shows saturated when both are equal:

{
  "queueMaxSize": 200,
  "queueFillCount": 200,
  "queueSaturated": true
}

There is something bogus here :)

Actions #3

Updated by François ARMAND over 7 years ago

The code is:

  lazy val queueSize = AtomicInt(0)
  ....

  def queueInfo() {
    ...
    val current = queueSize.get
    val saturated = (current+1) >= maxQueueSize
    val code = if(saturated) HttpStatus.TOO_MANY_REQUESTS else HttpStatus.OK
    ...
  }

  ...
  // see if you can add a file
  val canDo = synchronized {
    if(queueSize.incrementAndGet(1) <= maxQueueSize) {
      // the decrement will be done by the report processor
      true
    } else {
    ....

So for maxQueue = 50, in info, current queue = 49, +1 = 50 >= 50 => "saturated".
In canDo, current = 49, incrementAndGet(1) = 50 <= 50 => true

Actions #4

Updated by François ARMAND over 7 years ago

  • Category set to Web - Nodes & inventories
  • Assignee set to François ARMAND
  • Target version set to 4.1.8
  • User visibility changed from Infrequent - complex configurations | third party integrations to Operational - other Techniques | Technique editor | Rudder settings
  • Effort required set to Very Small
  • Priority changed from 22 to 49
Actions #5

Updated by François ARMAND over 7 years ago

  • Status changed from New to In progress
Actions #6

Updated by François ARMAND over 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/ldap-inventory/pull/119
Actions #7

Updated by François ARMAND over 7 years ago

  • Status changed from Pending technical review to Pending release
Actions #8

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 4.1.8 to 4.1.7
Actions #9

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.7 and 4.2.0~rc1 which were released today.

Actions

Also available in: Atom PDF