Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When close(positive, TimeUnit.MILLISECONDS) is called, it will try to do a normal close first. If the normal close did not finish before timeout, it then close the producer forcefully.

If sender thread call calls close(), it will block forever. So in close() we will check if the current thread is sender thread. If it is, an error message will be logged and close(-1) will be executed.

...