|
52 | 52 | import org.dcache.chimera.JdbcFs;
|
53 | 53 | import org.dcache.chimera.nfs.ChimeraNFSException;
|
54 | 54 | import org.dcache.chimera.nfs.ExportFile;
|
55 |
| -import org.dcache.chimera.nfs.FsExport; |
56 | 55 | import org.dcache.chimera.nfs.nfsstat;
|
57 | 56 | import org.dcache.chimera.nfs.v3.MountServer;
|
58 | 57 | import org.dcache.chimera.nfs.v3.NfsServerV3;
|
@@ -440,13 +439,26 @@ public List<deviceid4> getDeviceList(CompoundContext context) {
|
440 | 439 | * @see org.dcache.chimera.nfsv4.NFSv41DeviceManager#releaseDevice(stateid4 stateid)
|
441 | 440 | */
|
442 | 441 | @Override
|
443 |
| - public void layoutReturn(CompoundContext context, stateid4 stateid) { |
| 442 | + public void layoutReturn(CompoundContext context, stateid4 stateid) throws IOException { |
444 | 443 |
|
445 | 444 | _log.debug("Releasing device by stateid: {}", stateid);
|
446 |
| - Transfer transfer = _ioMessages.get(stateid); |
447 |
| - if (transfer != null) { |
448 |
| - _log.debug("Sending KILL to {}@{}", transfer.getMoverId(), transfer.getPool()); |
449 |
| - transfer.killMover(5000); |
| 445 | + |
| 446 | + NfsTransfer transfer = _ioMessages.get(stateid); |
| 447 | + if (transfer == null) { |
| 448 | + return; |
| 449 | + } |
| 450 | + |
| 451 | + _log.debug("Sending KILL to {}@{}", transfer.getMoverId(), transfer.getPool()); |
| 452 | + transfer.killMover(0); |
| 453 | + |
| 454 | + try { |
| 455 | + if(!transfer.waitForMover(500)) { |
| 456 | + throw new ChimeraNFSException(nfsstat.NFSERR_DELAY, "Mover not stopped"); |
| 457 | + } |
| 458 | + } catch (CacheException | InterruptedException e) { |
| 459 | + _log.info("Failed to kill mover: {}@{} : {}", |
| 460 | + transfer.getMoverId(), transfer.getPool(), e.getMessage()); |
| 461 | + throw new ChimeraNFSException(nfsstat.NFSERR_IO, e.getMessage()); |
450 | 462 | }
|
451 | 463 | }
|
452 | 464 |
|
@@ -571,7 +583,7 @@ protected NFS4ProtocolInfo getProtocolInfoForPoolManager() {
|
571 | 583 | protected NFS4ProtocolInfo getProtocolInfoForPool() {
|
572 | 584 | return _protocolInfo;
|
573 | 585 | }
|
574 |
| - } |
| 586 | + } |
575 | 587 |
|
576 | 588 | /**
|
577 | 589 | * To allow the transfer monitoring in the httpd cell to recognize us
|
|
0 commit comments