Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2401

Client creates or reuses current ResteasyContext by accident

    XMLWordPrintable

    Details

      Description

      A while ago Ken noticed that some MP TCK was using contextual objects (HttpHeaders IIRC) in a client filter, and it did not always work. We looked at the JAX-RS spec which said that most contextual objects were not supported for the client API, and corrected the TCK.

      Most likely it sometimes appeared to work if the client call was within a server call which had context.

      I was experimenting with thread contexts in RESTEasy today and looked at the client code and found that it requires a context, but it auto-creates one if there isn't one already. If I disabled the auto-creation, it failed.

      But I didn't find any code where it sets up its context, or clears it. So probably it's a bit risky at the moment because there can be some contextual objects in the client, but it's undefined.

      We should probably make it so client calls don't have a context, or have an empty one.

        Attachments

          Activity

            People

            Assignee:
            FroMage Stephane Epardaud
            Reporter:
            FroMage Stephane Epardaud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: