Skip to content

Commit 77b7aca

Browse files
committed
pool: Fix lock problems in xrootd and http movers
When the pool is full, a blocking preallocate call could block simple 'mover ls' queries and thus cause the entire pool to appear unresponsive. Target: trunk Request: 2.8 Request: 2.7 Request: 2.6 Require-notes: yes Require-book: no Acked-by: Dmitry Litvintsev <litvinse@fnal.gov> Patch: http://rb.dcache.org/r/6795/ (cherry picked from commit a5b01e4)
1 parent e9cff2e commit 77b7aca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/dcache/src/main/java/org/dcache/pool/movers/MoverChannel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public class MoverChannel<T extends ProtocolInfo> implements RepositoryChannel
8080

8181
/**
8282
* The number of bytes reserved in the space allocator. Only
83-
* accessed while the monitor lock is held.
83+
* updated while the monitor lock is held.
8484
*/
85-
private long _reserved;
85+
private volatile long _reserved;
8686

8787
public MoverChannel(Mover<T> mover, RepositoryChannel channel)
8888
{
@@ -162,7 +162,7 @@ public synchronized int read(ByteBuffer dst) throws IOException
162162
}
163163

164164
@Override
165-
public synchronized int read(ByteBuffer buffer, long position) throws IOException {
165+
public int read(ByteBuffer buffer, long position) throws IOException {
166166
try {
167167
int bytes = _channel.read(buffer, position);
168168
_bytesTransferred.getAndAdd(bytes);
@@ -301,7 +301,7 @@ public long getLastTransferred() {
301301
return _lastTransferred.get();
302302
}
303303

304-
public synchronized long getAllocated() {
304+
public long getAllocated() {
305305
return _reserved;
306306
}
307307

0 commit comments

Comments
 (0)