I am chasing an issue that I initially saw when testing XrdEc. I have since come up with a standalone testing case that is not related to using XrdEc. The test code and instruction to compile the code is pasted at the bottom. Note that

  1. Once compile, pls run against a xrootd server to created a new ZIP archive

  2. The program will never finish. If turning on XRD_LOGEVEL=Error, I see message like the following after a while:
    [2023-04-30 21:13:01.694793 -0700][Error ][AsyncSock ] [cent7b:1094.0] Socket error encountered: [ERROR] Socket error: connection reset by peer
    [2023-04-30 21:13:01.694852 -0700][Error ][XRootD ] [cent7b:1094] Impossible to send message kXR_writev (handle: 0x00000000, chunks: 1, total size: 2097211). Trying to recover.
    [2023-04-30 21:13:01.694863 -0700][Error ][XRootD ] [cent7b:1094] Unable to get the response to request kXR_writev (handle: 0x00000000, chunks: 1, total size: 2097211)

  3. it can not be compiled with devel rpm because of "#include <XrdCl/XrdClCtx.hh>". This is what is used in XrdEc.

  4. This issue is sensitive to the setting of MAX_FILES_IN_ZIP, size_t fsize and std::string fn in the testing code. If we reduce MAX_FILES_IN_ZIP by 1 (while keeping "fsize" and "fn" unchanged), all will work just fine.

  5. It is possible that the MAX_FILES_IN_ZIP setting is related to my environment. You may need to set it to something much larger to see this issue.


/* How to compile
scl enable devtoolset-9 sh
g++ -g -o xrdzip_write.exe xrdzip_write.cc
-I/afs/slac/package/xrootd/xrootd-5.5.1/xrootd/src
-I/afs/slac/package/xrootd/xrootd-5.5.1/amd64_rhel70/src
-Wl,--copy-dt-needed-entries
-L/afs/slac/package/xrootd/xrootd-5.5.1/amd64_rhel70/src
-L/afs/slac/package/xrootd/xrootd-5.5.1/amd64_rhel70/src/XrdCl
-l XrdCl
*/

#include <stdio.h>
#include
#include <XrdCl/XrdClXRootDResponses.hh>
#include <XrdCl/XrdClURL.hh>
#include <XrdCl/XrdClFile.hh>
#include <XrdCl/XrdClCtx.hh>
#include <XrdCl/XrdClFileSystem.hh>
#include <XrdCl/XrdClZipArchive.hh>
#include <XrdCl/XrdClZipOperations.hh>
#include <XrdOuc/XrdOucCRC32C.hh>

#define MAX_FILES_IN_ZIP 36251

int main(int argc, char* argv[]) {
XrdCl::URL url(argv[1]);
XrdCl::XRootDStatus st;

size_t fsize = 128*1024;
char *buff = (char*)malloc(fsize);
uint32_t cksm = crc32c(0, buff, fsize);

XrdCl::ZipArchive zip;
XrdCl::Ctx<XrdCl::ZipArchive> pzip = zip;

st = XrdCl::WaitFor(XrdCl::OpenArchive(pzip, url.GetURL(), XrdCl::OpenFlags::New | XrdCl::OpenFlags::Update));
if (!st.IsOK()) {
    printf("ZipArchive Open fail\n");
    exit(1);
}
else
    printf("ZipArchive Open successfully\n");

for (int i=0; i<MAX_FILES_IN_ZIP; i++) {
    std::string fn = "obj." + std::to_string(i) + ".1";
    printf("Open file %s : ", fn.c_str());
    st = XrdCl::WaitFor(XrdCl::AppendFile(pzip, fn, cksm, fsize, buff));
    if (!st.IsOK()) {
       printf("fail %s\n", st.ToString().c_str());
       exit(1);
    }
    else
       printf("successfully\n");
}

printf("closing ZipArchive ...\n");
st = XrdCl::WaitFor(XrdCl::CloseArchive(pzip));
if (!st.IsOK()) {
    printf("ZipArchive Close fail\n");
    exit(1);
}
else
    printf("ZipArchive Close successfully\n");

exit(0);

}


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/issues/2004@github.com>

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/issues/2004", "url": "https://github.com/xrootd/xrootd/issues/2004", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

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