Просмотр исходного кода

Note migration errors are not fatal

mirokuratczyk 5 лет назад
Родитель
Сommit
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
         // are cleaned up; failing to do so may result in data store corruption or other undefined
         // 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,
                                       String feedbackConfigJson, String diagnosticsJson, String uploadPath,
                                       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
  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.
+ @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
        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
 //   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 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
 //   that the PsiphonProviderFeedbackHandler.SendFeedbackCompleted() callback
 //   is delivered on can cause a deadlock. I.E. the callback code must return