Whamcloud - gitweb
LU-14051 utils: flush alr batch file in thread 10/40310/7
authorJohn L. Hammond <jhammond@whamcloud.com>
Thu, 17 Sep 2020 20:56:55 +0000 (15:56 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Nov 2020 08:15:06 +0000 (08:15 +0000)
In ofd_access_log_reader, move flushing of the batch file thread to
the sort and print thread.

Test-Parameters: trivial
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Id1e008ede6c05e24ea2e2459520d6585007acc7d
Reviewed-on: https://review.whamcloud.com/40310
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/ofd_access_batch.c
lustre/utils/ofd_access_log_reader.c

index c5b4180..75cd43e 100644 (file)
@@ -433,6 +433,8 @@ void *alr_sort_and_print_thread(void *arg)
        }
 
 out:
+       fflush(aa->file);
+
        list_for_each_entry_safe(alre, next, tmp, alre_fid_hash_node.fhn_node) {
                alre_del_init(alre);
                free(alre);
index 5bbc20a..44986f6 100644 (file)
@@ -508,14 +508,6 @@ static int alr_batch_timer_io(int epoll_fd, struct alr_dev *td, unsigned int mas
                        alr_batch_file_path, strerror(errno));
                goto out;
        }
-
-       /* FIXME: blocking write to batch file. */
-       rc = fflush(alr_batch_file);
-       if (rc < 0) {
-               ERROR("cannot write to '%s': %s\n",
-                       alr_batch_file_path, strerror(errno));
-               goto out;
-       }
 out:
        /* Failed writes will leave alr_batch_file (pipe) in a
         * weird state so make that fatal. */