[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: store: Add missing buffer flushes.
From: |
Ludovic Courtès |
Subject: |
01/03: store: Add missing buffer flushes. |
Date: |
Mon, 17 Sep 2018 17:20:14 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 3809824199cdd52446176c9cd4761dd09f732542
Author: Ludovic Courtès <address@hidden>
Date: Mon Sep 17 22:00:26 2018 +0200
store: Add missing buffer flushes.
This could result in deadlock in unusual situations, whereby we'd start
waiting for a reply while the query hasn't been flushed to the socket.
* guix/store.scm (buffering-output-port)[flush]: Add call to
'force-output'.
(add-to-store): Add call to 'write-buffered-output'.
---
guix/store.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/guix/store.scm b/guix/store.scm
index af7f698..cc5dcef 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -770,6 +770,7 @@ bytevector) as its internal buffer, and a thunk to flush
this output port."
(define (flush)
(put-bytevector port buffer 0 total)
+ (force-output port)
(set! total 0))
(define (write bv offset count)
@@ -927,6 +928,7 @@ path."
(write-int (if recursive? 1 0) port)
(write-string hash-algo port)
(write-file file-name port #:select? select?)
+ (write-buffered-output server)
(let loop ((done? (process-stderr server)))
(or done? (loop (process-stderr server))))
(read-store-path port)))))