jan-gerling / FLOCKA

1 stars 1 forks source link

Sagas implementation #31

Closed PSilvestre closed 5 years ago

PSilvestre commented 5 years ago

SEC implemented with accompanying tests and mocks.

jan-gerling commented 5 years ago

I did some testing on your branch and found that the Sagas have very high response times, often more than 5000 milis, thus all asks timeout.

PSilvestre commented 5 years ago

There is a Thread.sleep in the MockLoadBalancer on purpose. The objective is to cause it to timeout and try again with higher timeout-time. Is this what you are refering to?

If you delete those sleeps it should run a lot faster.

jan-gerling commented 5 years ago

They are all deactivated, thus that should not be any problem.

You might wanna test it on your own:

val t0: Long = System.nanoTime()
          val futureSaga = secShard ? ExecuteSaga(testSaga)
          futureSaga.onComplete{
            case Success(value) =>
              val elapsedTime: Double = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t0)
              println(value + " took: " + elapsedTime + " " + TimeUnit.MICROSECONDS.toString)
          }
jan-gerling commented 5 years ago

Two general problems, are valid for my branch are:

  1. The Sagas takes to long and timesout: It is not stopped and rolledback, but back keeps executing. The requester thinks it wasnt done though.
  2. The Node of a SEC dies: We will not recover the SAGAs, because we never recover the individual SEC, even though it is persisted in the journal.