ID 138782 - Write node doesn't close MOV or MXF files until after the afterRender callback script

Follow

Problem summary:
When using the "afterRender" callback on a .mov or .mxf Write node, the callback runs before the file has finished processing / is complete. This can cause problems if the afterRender callback is used to do an action on the MOV/MXF file as it will act on an incomplete file.

Customer reported version:
14.0v3

Customer reported platform:
Windows 10

Steps to reproduce:
1) Launch Nuke and create a Write node in the Node Graph.
2) Set the Write node's file to an ".mov" or ".mxf" type.
3) In the Python tab, paste the following code into the "After Render" knob:

  print(os.path.getsize("<FILEPATH>"))

Please note: Replace "<FILEPATH>" with your write node's "filepath" output.
4) Render the file.
5) Paste the above code from step 3 into your 'Script Editor' and execute the code.
6) Observe the file size difference between the printed 'After Render' file readout and the self entered file readout.

Expected behavior:
The afterRender callback should run when the .mov / .mxf is complete.

Actual behavior:
The afterRender callback runs too early when the .mov / .mxf is incomplete.

Workaround:

Option 1:
Spawn a new thread:
thread.start_new_thread(postRenderFunction, (args))

Option 2:
Run your Python script separately afterwards.
Please note: Adding a 'time.sleep()' after your function waits before the file is complete so it doesn't work.

Reproduced by Support in:
Nuke 14.0v6 - Windows 10, CentOS 7
Nuke 13.0v1 - Windows 10
Nuke 12.0v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.0v1 - Windows 10, CentOS 7

Earliest version tested:
Nuke 10.0v1 - Issue appears to be in all tested versions of the product

    We're sorry to hear that

    Please tell us why