Print

Print


When direct reads ("bypass mode") are in use, the code was failing to increment the number of bytes serviced in the read request.  When there were no errors, that means the overall read operation returned 0 instead of the bytes read.

This resulted in 100% failure rate for HTTP requests when direct read mode was activated.

This was tested by disabling prefetch and then always forcing direct reads via this simple patch:

```
--- a/src/XrdPfc/XrdPfcFile.cc
+++ b/src/XrdPfc/XrdPfcFile.cc
@@ -804,7 +804,7 @@ int File::ReadOpusCoalescere(IO *io, const XrdOucIOVec *readV, int readVnum,
                read_req = new ReadRequest(io, rh);
 
             // Is there room for one more RAM Block?
-            Block *b = PrepareBlockRequest(block_idx, io, read_req, false);
+            Block *b = nullptr; // = PrepareBlockRequest(block_idx, io, read_req, false);
             if (b)
             {
                TRACEF(Dump, tpfx << "inc_ref_count new " <<  (void*)iUserBuff << " idx = " << block_idx);
```

Before -- HTTP requests would hang 100% of the time.  After -- everything worked.
You can view, comment on, or merge this pull request online at:

  https://github.com/xrootd/xrootd/pull/1918

-- Commit Summary --

  * Fix direct read for PFC

-- File Changes --

    M src/XrdPfc/XrdPfcFile.cc (4)

-- Patch Links --

https://github.com/xrootd/xrootd/pull/1918.patch
https://github.com/xrootd/xrootd/pull/1918.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1918
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1