Petals ESB Container

PetalsExecutionContext eats too much resources

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 5.0.1
  • Fix Version/s: 5.0.2
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    ExecutionContext is used in PetalsExecutionContext, the main entry point to store flow-related information for logs.

    It is a MDC-like implementation using Properties objects.

    The problem with it is that it relies on a recursive Properties objects: every time a thread is created, a new Properties object is created (this is ok) using the previous thread as a parent (this is not ok).

    When used in Thread pools, often threads of the pool are responsible of creating new threads, and thus after a long time, we can find ourselves with a very long chain of inheriting Properties object, and after a very very long time, this can result in StackOverflowError when trying to resolve properties in them.

    Hence, we should switch from the use of ExecutionContext to a better MDC implementation, such as the one provided by default by SLF4J, since it is a future plan to switch to SLF4J (PETALSDISTRIB-135).

    Show
    ExecutionContext is used in PetalsExecutionContext, the main entry point to store flow-related information for logs. It is a MDC-like implementation using Properties objects. The problem with it is that it relies on a recursive Properties objects: every time a thread is created, a new Properties object is created (this is ok) using the previous thread as a parent (this is not ok). When used in Thread pools, often threads of the pool are responsible of creating new threads, and thus after a long time, we can find ourselves with a very long chain of inheriting Properties object, and after a very very long time, this can result in StackOverflowError when trying to resolve properties in them. Hence, we should switch from the use of ExecutionContext to a better MDC implementation, such as the one provided by default by SLF4J, since it is a future plan to switch to SLF4J (PETALSDISTRIB-135).
  • Environment:
    -

Issue Links

Activity

Victor NOËL made changes - Tue, 31 May 2016 - 13:15:07 +0200
Field Original Value New Value
Status New [ 10000 ] Open [ 10002 ]
Priority Major [ 3 ]
Assignee Christophe DENEUX [ cdeneux ] Victor NOËL [ vnoel ]
Victor NOËL made changes - Tue, 31 May 2016 - 13:15:10 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Victor NOËL made changes - Tue, 31 May 2016 - 13:17:48 +0200
Link This issue depends on PETALSDISTRIB-256 [ PETALSDISTRIB-256 ]
Victor NOËL made changes - Tue, 31 May 2016 - 13:18:24 +0200
Link This issue blocks PETALSDISTRIB-135 [ PETALSDISTRIB-135 ]
Victor NOËL made changes - Tue, 31 May 2016 - 13:19:22 +0200
Fix Version/s 5.0.2 [ 10661 ]
Christophe DENEUX made changes - Tue, 31 May 2016 - 16:54:19 +0200
Link This issue depends on PETALSCDK-173 [ PETALSCDK-173 ]
Victor NOËL made changes - Wed, 1 Jun 2016 - 11:21:08 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Resolution Fixed [ 1 ]

People

Dates

  • Created:
    Tue, 31 May 2016 - 13:14:09 +0200
    Updated:
    Wed, 1 Jun 2016 - 11:21:08 +0200
    Resolved:
    Wed, 1 Jun 2016 - 11:21:08 +0200