Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-25568

Preprocessing script cache is not invalidated after macro changes

XMLWordPrintable

    • S24-W48/49, S24-W50/51/52
    • 1

      Steps to reproduce:

      1. Create host with trapper item
      2. Add javascript preprocessing: return "{$MACRO}"
      3. Add host macro {$MACRO} with value 1
      4. Start server
      5. Send value to item
      6. Check item value in latest data -> 1
      7. Update {$MACRO} value to 2
      8. Reload server configuration cache
      9. Send value to item
      10. Check item value in latest data

      The item value is still 1 while it should be 2.

      This happens because preprocessing caches the compiled bytecode and resets this cache only on item error or preprocessing change. Since macros are resolved directly in script code, the cached bytecode will have old macro values.

      There are several ways to fix it.
      1) scrap the bytecode caching. This will have some performance impact, but easy to implement and will not affect other preprocessing steps.
      2) drop preprocessing cache during preprocessing configuration update if item has javascript preprocessing steps. This would affect other steps like 'change' or throttling'. For example change would be reset whenever host or linked template macro changes.

            wiper Andris Zeila
            wiper Andris Zeila
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: