Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

bug fix #11

Merged
merged 3 commits into from about 2 years ago

2 participants

Courtney Robinson Lorenzo Alberton
Courtney Robinson
Collaborator

Client would create a new thread when something went wrong.
This was incorrect, this patch addresses this issue.

It also addresses the issue where invalid interactions could be created if the client lost the connection before reading all the contents of an interaction when the retry is successful, the new interaction is appended to the incomplete interaction.

Lorenzo Alberton quipo merged commit 7a3bb72 into from April 04, 2012
Lorenzo Alberton quipo closed this April 04, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
10  Datasift/DatasiftStream/DatasiftStream.cs
@@ -199,7 +199,8 @@ private void ImediateRetry(string msg)
199 199
                 Thread.Sleep(linearConnectTimeoutLength * 1000);
200 200
                 linearConnectTimeoutLength += 1;//+1 
201 201
                 connectCount++;
202  
-                Consume();
  202
+                status = State.RUNNING;
  203
+                StartStreaming();
203 204
             }
204 205
             else
205 206
             {
@@ -215,7 +216,8 @@ private void Retry(string msg)
215 216
                 Thread.Sleep(exponentialConnectTimeoutLength * 1000);
216 217
                 exponentialConnectTimeoutLength *= 2;//double wait time
217 218
                 connectCount++;
218  
-                Consume();
  219
+                status = State.RUNNING;
  220
+                StartStreaming();
219 221
             }
220 222
             else
221 223
             {
@@ -237,7 +239,8 @@ private void StopOrRetry(string msg)
237 239
                 //if we end up here, we've run out of retries, do retry after fixed time
238 240
                 int time = Math.Max(config.StaticRetryTimeout, 30000); //retry after min of 30 seconds
239 241
                 Thread.Sleep(time);
240  
-                Consume();
  242
+                status = State.RUNNING;
  243
+                StartStreaming();
241 244
             } 
242 245
         }
243 246
         /// <summary>
@@ -316,7 +319,6 @@ private void PushToSubscribers(string data)
316 319
                 Interaction interaction = new Interaction(data);
317 320
                 if (interaction.IsError())
318 321
                 {
319  
-                    Retry(interaction.StatusMessage());
320 322
                     return;
321 323
                 }
322 324
                 foreach (DatasiftStreamClient c in this.subcribers)
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.