azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Azure Storage python azure storage fileshare get copy success status delay

Open itbinbin opened this issue 3 years ago • 3 comments

  • Package Name:
    • azure.storage.fileshare
  • Package Version:
  • 12.8.0 12.9.0 12.10.0b1
  • Operating System:
  • windows 10
  • Python Version: 3.8.5 Describe the bug when copy file from azure storage blob to another storage file , we can see the file have already copy complete in storage explorer,but in code,we get copy success status delay,it always pending long time。this influenced our production environment needs. please help asap.

To Reproduce CODE: from azure.core.exceptions import ( ResourceExistsError, ResourceNotFoundError ) import time from azure.storage.fileshare import ( ShareServiceClient, ShareClient, ShareDirectoryClient, ShareFileClient )

Create a ShareServiceClient from a connection string

connection_string="xxxx" service_client = ShareServiceClient.from_connection_string(connection_string) share = ShareClient.from_connection_string(connection_string, "testforcustomer") source_file = share.get_file_client("copy-file05") address="xxxxx" source_file.start_copy_from_url(source_url=address) n = 1 while n <= 100: time.sleep(5) r = source_file.get_file_properties() print("past "+str((n-1)*5)+"s----"+r['copy']['status']) n = n + 1 if(r['copy']['status']== "success"): break; print('END') 图片

itbinbin avatar Sep 21 '22 06:09 itbinbin

Hi @itbinbin thanks for the feedback, we'll get back to you asap.

l0lawrence avatar Sep 21 '22 15:09 l0lawrence

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Sep 21 '22 15:09 ghost

Hi @itbinbin, how are you confirming the copy has succeeded in Storage Explorer? If you are just going on the fact that the blob appears in the Share, that is likely not enough information.

When performing an async copy, the destination file will be created first and then the copy will start/complete at a later time. This is what enables you to call get_file_properties on a pending copy. So just because the file appears in Storage Explorer, doesn't mean the copy is finished. They only way to determine the copy status is by looking at the properties as you are doing.

jalauzon-msft avatar Sep 21 '22 18:09 jalauzon-msft

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Oct 01 '22 02:10 ghost