IBM Support

IJ29942: SENDFILE SYS CALL CAN CAUSE BLOCKINGIOERROR

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • node running kernel 4.18.0-193.19.1.el8_2 with python3.8
    hits the following error:
    
    [root@node]# python3.8 -c "import shutil;
    shutil.copyfile('test.txt','new.txt')"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib64/python3.8/shutil.py", line 270, in
    copyfile
        _fastcopy_sendfile(fsrc, fdst)
      File "/usr/lib64/python3.8/shutil.py", line 169, in
    _fastcopy_sendfile
        raise err
      File "/usr/lib64/python3.8/shutil.py", line 149, in
    _fastcopy_sendfile
        sent = os.sendfile(outfd, infd, offset, blocksize)
    BlockingIOError: [Errno 11] Resource temporarily
    unavailable: 'test.txt' -> 'new.txt'
    

Local fix

  • In Python 3.8 and beyond, setting shutil._USE_CP_SENDFILE to
    False directs
    shutil.copyfile() to avoid calling the sendfile() system
    call.  The root
    cause of the issue involves the sendfile() system call and
    how it is handled
    in Spectrum Scale for certain Linux kernel levels.  This
    workaround causes
    Python to avoid making that system call.
    
        Here is an example:
    
        [root@node]# python3.8 -c "import shutil;
        shutil._USE_CP_SENDFILE = False
        shutil.copyfile('test.txt','new.txt')"
    

Problem summary

  • In a kernel >4.10 and file-sizes being a multiple of
    page sizes, a false error is returned by sendfile() once the
    read offset reaches file size.
    

Problem conclusion

  • Benefits of the solution:
    No more blocking IO errors
    Work Around:
    For Python 3.8 and beyond, setting shutil._USE_CP_SENDFILE to
    False instructs
    shutil.copyfile() to avoid calls to sendfile().
    For application which calls sendfile() directly, upgrading
    Spectrum Scale to
    a level which includes the fix of this APAR.
    Problem trigger:
    Having a file size that is a multiple of the page size
    Symptom:
    Unexpected Results/Behavior
    Platforms affected: All
    Functional Area affected: All
    Customer Impact: Suggested
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ29942

  • Reported component name

    SPEC SCALE STD

  • Reported component ID

    5737F33AP

  • Reported release

    510

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-12-15

  • Closed date

    2022-03-11

  • Last modified date

    2022-03-11

  • APAR is sysrouted FROM one or more of the following:

    IJ28891

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    SPEC SCALE STD

  • Fixed component ID

    5737F33AP

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"STXKQY"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"510","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

Modified date:
12 March 2022