Kafka
  1. Kafka
  2. KAFKA-328

Write unit test for kafka server startup and shutdown API

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Background discussion in KAFKA-320

      People often try to embed KafkaServer in an application that ends up calling startup() and shutdown() repeatedly and sometimes in odd ways. To ensure this works correctly we have to be very careful about cleaning up resources. This is a good practice for making unit tests reliable anyway.

      A good first step would be to add some unit tests on startup and shutdown to cover various cases:
      1. A Kafka server can startup if it is not already starting up, if it is not currently being shutdown, or if it hasn't been already started
      2. A Kafka server can shutdown if it is not already shutting down, if it is not currently starting up, or if it hasn't been already shutdown.

        Activity

        Neha Narkhede created issue -
        Jay Kreps made changes -
        Field Original Value New Value
        Description Background discussion in KAFKA-320

        startup and shutdown needs to be fixed to ensure correct behavior on repeated calls to the API. One of the possible checks would be -

        1. A Kafka server can startup if it is not already starting up, if it is not currently being shutdown, or if it hasn't been already started

        2. A Kafka server can shutdown if it is not already shutting down, if it is not currently starting up, or if it hasn't been already shutdown.
        Background discussion in KAFKA-320

        People often try to embed KafkaServer in an application that ends up calling startup() and shutdown() repeatedly and sometimes in odd ways. To ensure this works correctly we have to be very careful about cleaning up resources. This is a good practice for making unit tests reliable anyway.

        A good first step would be to add some unit tests on startup and shutdown to cover various cases:
        1. A Kafka server can startup if it is not already starting up, if it is not currently being shutdown, or if it hasn't been already started
        2. A Kafka server can shutdown if it is not already shutting down, if it is not currently starting up, or if it hasn't been already shutdown.
        Jay Kreps made changes -
        Summary Improve kafka server startup and shutdown API Write unit test for kafka server startup and shutdown API
        Jay Kreps made changes -
        Labels newbie

          People

          • Assignee:
            Unassigned
            Reporter:
            Neha Narkhede
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development