geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirk Lund (JIRA)" <>
Subject [jira] [Created] (GEODE-3278) Empty status file causes status server and status locator to hang
Date Thu, 20 Jul 2017 21:34:00 GMT
Kirk Lund created GEODE-3278:

             Summary: Empty status file causes status server and status locator to hang
                 Key: GEODE-3278
             Project: Geode
          Issue Type: Bug
          Components: gfsh
            Reporter: Kirk Lund

I added the following test to FileProcessControllerIntegrationTest to improve code coverage
and hit this hang.
  public void emptyStatusFileCausesStatusToHang() throws Exception {
    // given: FileProcessController with pidFile containing real pid
    new IntegerFileWriter(pidFile).writeToFile(pid);
    FileProcessController controller = new FileProcessController(params, pid, 2, MINUTES);

    // when: status is called in one thread
    executor.execute(() -> {
      try {
      } catch (Exception e) {

    // and: json is written to the status file
    new EmptyFileWriter(statusFile).createNewFile();

    // then: returned status should be the json in the file
    await().until(() -> assertThat(statusRef.get()).isEqualTo(STATUS_JSON));
FileProcessController wait forever to read from that status file:
    ControlRequestHandler statusHandler = () -> {
      // read the statusFile
      StringBuilder lines = new StringBuilder();
      try (BufferedReader reader = new BufferedReader(new FileReader(statusFile))) {
        String line;
        while ((line = reader.readLine()) != null) {
      } finally {
The above is blocking file reader which cannot be interrupted on Windows. If we change the
code to be interrupted then we'll need to change to a non-blocking implementation so it can
be interrupted on Windows.

This message was sent by Atlassian JIRA

View raw message