Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2566

WeldAlterableContext clearAndSet() needs to clear caches

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.1.Final
    • 3.1.0.Final
    • None
    • None

      Implementations of clearAndSet() method from WeldAlterableContext have to invoke RequestScopedCache.invalidate(). This makes sure the ThreadLocal caches for request/session/conversation scopes are flushed.

      This isn't normally a problem if you propagate contexts into a different thread. However, if you temper with context states on the same (main) thread, you will now end up in a weird state where context storage is empty, but caches still return old references.

      This scenario is from MP Concurrency where there is no guarantee which thread will be used for execution.

      A workaround is to manually invoke RequestScopedCache.invalidate() whenever integrator deals with propagation as the method is static. Though this requires weld-core dependency.

            [WELD-2566] WeldAlterableContext clearAndSet() needs to clear caches

            There are no comments yet on this issue.

              manovotn Matěj Novotný
              manovotn Matěj Novotný
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: