Преглед изворни кода

Note migration errors are not fatal

mirokuratczyk пре 5 година
родитељ
комит
616c97a17b

+ 5 - 0
MobileLibrary/Android/PsiphonTunnel/PsiphonTunnel.java

@@ -373,6 +373,11 @@ public class PsiphonTunnel {
         // stopSendFeedback() before the process exits. This ensures that any underlying resources
         // stopSendFeedback() before the process exits. This ensures that any underlying resources
         // are cleaned up; failing to do so may result in data store corruption or other undefined
         // are cleaned up; failing to do so may result in data store corruption or other undefined
         // behavior.
         // behavior.
+        // - PsiphonTunnel.startTunneling and startSendFeedback both make an attempt to migrate
+        // persistent files from legacy locations in a one-time operation. If these functions are
+        // called in parallel, then there is a chance that the migration attempts could execute at
+        // the same time and result in non-fatal errors in one, or both, of the migration
+        // operations.
         public void startSendFeedback(Context context, HostFeedbackHandler feedbackHandler, HostLogger logger,
         public void startSendFeedback(Context context, HostFeedbackHandler feedbackHandler, HostLogger logger,
                                       String feedbackConfigJson, String diagnosticsJson, String uploadPath,
                                       String feedbackConfigJson, String diagnosticsJson, String uploadPath,
                                       String clientPlatformPrefix, String clientPlatformSuffix) {
                                       String clientPlatformPrefix, String clientPlatformSuffix) {

+ 3 - 0
MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.h

@@ -468,6 +468,9 @@ Returns the path where the rotated notices file will be created.
  @warning An ongoing feedback upload started with `startSendFeedback:` should be stopped with `stopSendFeedback` before the
  @warning An ongoing feedback upload started with `startSendFeedback:` should be stopped with `stopSendFeedback` before the
  process exits. This ensures that any underlying resources are cleaned up; failing to do so may result in data store corruption or other
  process exits. This ensures that any underlying resources are cleaned up; failing to do so may result in data store corruption or other
  undefined behavior.
  undefined behavior.
+ @warning `PsiphonTunnel.start:` and `startSendFeedback:`  both make an attempt to migrate persistent files from legacy locations in a
+ one-time operation. If these functions are called in parallel, then there is a chance that the migration attempts could execute at the same
+ time and result in non-fatal errors in one, or both, of the migration operations.
  */
  */
 - (void)startSendFeedback:(NSString * _Nonnull)feedbackJson
 - (void)startSendFeedback:(NSString * _Nonnull)feedbackJson
        feedbackConfigJson:(id _Nonnull)feedbackConfigJson
        feedbackConfigJson:(id _Nonnull)feedbackConfigJson

+ 2 - 2
MobileLibrary/psi/psi.go

@@ -324,8 +324,8 @@ var sendFeedbackWaitGroup *sync.WaitGroup
 // - Start and StartSendFeedback both make an attempt to migrate persistent
 // - Start and StartSendFeedback both make an attempt to migrate persistent
 //   files from legacy locations in a one-time operation. If these functions
 //   files from legacy locations in a one-time operation. If these functions
 //   are called in parallel, then there is a chance that the migration attempts
 //   are called in parallel, then there is a chance that the migration attempts
-//   could execute at the same time and result in errors in one, or both, of the
-//   migration operations.
+//   could execute at the same time and result in non-fatal errors in one, or
+//   both, of the migration operations.
 // - Calling StartSendFeedback or StopSendFeedback on the same call stack
 // - Calling StartSendFeedback or StopSendFeedback on the same call stack
 //   that the PsiphonProviderFeedbackHandler.SendFeedbackCompleted() callback
 //   that the PsiphonProviderFeedbackHandler.SendFeedbackCompleted() callback
 //   is delivered on can cause a deadlock. I.E. the callback code must return
 //   is delivered on can cause a deadlock. I.E. the callback code must return