Skip to content

HystrixObservableCommand does not allow setting thread pool id? #805

Closed

Description

@abelnation

Perhaps I'm not understanding the difference properly, but it's strange that I cannot set the thread pool key on a HystrixObservableCommand. Is that done for any specific reason? Thanks

Activity

  1. mattrjacobs commented on Jun 5, 2015

    @mattrjacobs
    Contributor

    This is an oversight. I'll add this Setter to the constructor of HystrixObservableCommand for the next release. Thanks for the report.

  2. benjchristensen commented on Jun 5, 2015

    @benjchristensen
    Contributor

    Even though it is possible, it's generally inappropriate for a HystrixObservableCommand to be using a thread since that kind of defeats the point of avoiding threads and wrapping non-blocking Observables.

    HystrixObservableCommand is for wrapping non-blocking Observables. If the Observable is blocking, then it is questionable as to why an Observable is being used and thus HystrixCommand is probably the right thing since it is blocking.

    If there is a legit reason for the Observable to be blocking, and subscribeOn(Schedulers.io()) is not the right solution, then yes, Hystrix threads can be used to make it async. But that's not the intended pattern.

  3. PK85 commented on Jun 18, 2015

    @PK85

    Hello Ben,

    You said that HystrixObservableCommand is for wrapping non-blocking Observables and in our case to achieve that we are using async javax.ws.rs.client and invocation callback in construct method. How hystrix thread isolation can make it blocking or maybe it doesn't fit each other in another aspect?

    Cheers, Piotr

  4. benjchristensen commented on Jun 18, 2015

    @benjchristensen
    Contributor
  5. PK85 commented on Jun 18, 2015

    @PK85

    Thank you for your clarification.

    Btw I was thinking to switch from semaphore to thread isolation to solve my hystrix command maxConcurrentRequests issue, but that was wrong assumption. I have three instances of my service launched on tomcat with hystrix command execution/falback.isolation.semaphore.maxConcurrentRequests property set to 200, and we were not able to acquire semaphore from time to time.

    From hystrix documentation I see that semaphore should still be a small percentage of the overall container (i.e. Tomcat) thread pool. It probably means I should set less than 200 (cause default tomcat thread pool is 200) and use 7,8 instances then.

    Cheers, PK

  6. mattrjacobs commented on Jul 22, 2015

    @mattrjacobs
    Contributor

    @abelnation - Did @benjchristensen's clarification answer your question, or are you still in favor of adding this configuration ability?

  7. PK85 commented on Jul 22, 2015

    @PK85

    Clarified, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址