Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs_io_thr loop is not waiting for timeout #5

Closed
sylgal opened this issue Sep 22, 2014 · 0 comments
Closed

fs_io_thr loop is not waiting for timeout #5

sylgal opened this issue Sep 22, 2014 · 0 comments

Comments

@sylgal
Copy link

sylgal commented Sep 22, 2014

There is a missing mutex_lock/unlock enclosing fs_pthread_cond_timedwait.
On FreeBSD (at least) it return [EPERM] and never wait for timeout.

Here is the patch to correct this issue:

--- fstrm/fstrm.c.orig 2014-09-19 16:42:26.000000000 +0200
+++ fstrm/fstrm.c 2014-09-19 17:01:14.000000000 +0200
@@ -634,9 +634,11 @@
if (count != 0)
continue;

  •            pthread_mutex_lock(&io->cv_lock);
            res = fs_pthread_cond_timedwait(io->clkid_pthread,
                                          &io->cv, &io->cv_lock,
                                          io->opt.flush_timeout);
    
  •            pthread_mutex_unlock(&io->cv_lock);
            if (res == ETIMEDOUT)
                    fs_io_flush_output(io);
    }
    
@edmonds edmonds closed this as completed in cb2a393 Nov 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant