Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-510

Avoid an ArithmeticException in AbstractMultiworkerIOReactor by failing earlier by checking ioThreadCount in IOReactorConfig constructor.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.4.10, 5.0-beta3
    • None
    • None

    Description

      Avoid an ArithmeticException in AbstractMultiworkerIOReactor by failing eariler by checking ioThreadCount in IOReactorConfig constructor.

      If you build an IOReactorConfig with an ioThreadCount equal to 0, you will get the exception below. This can be avoided by failing earlier in the IOReactorConfig constructor.

      java.lang.ArithmeticException: / by zero
      	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.addChannel(AbstractMultiworkerIOReactor.java:473) ~[httpcore-nio-4.4.9.jar:4.4.9]
      	at org.apache.http.impl.nio.reactor.DefaultListeningIOReactor.processEvent(DefaultListeningIOReactor.java:189) ~[httpcore-nio-4.4.9.jar:4.4.9]
      	at org.apache.http.impl.nio.reactor.DefaultListeningIOReactor.processEvents(DefaultListeningIOReactor.java:151) ~[httpcore-nio-4.4.9.jar:4.4.9]
      	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348) ~[httpcore-nio-4.4.9.jar:4.4.9]
      

      Instead of the above, you will get an IllegalArgumentException from the IOReactorConfig constructor.

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: