EricssonResearch / calvin-base

Calvin is an application environment that lets things talk to things, among other things.
Apache License 2.0
282 stars 91 forks source link

Issues with the migration of some actors (RecTimer, FileReader, FileWriter) #81

Closed brunodonassolo closed 7 years ago

brunodonassolo commented 7 years ago

Hello again,

I'm sending a possible second patch to fix some issues related to actors migration. This is a little bigger than the first one, so please don't hesitate to say me if there are things to improve (probably there is :)).

The errors happen when the actor (RecTimer, FileReader or FileWriter) is migrated from one runtime to another. RecTimer: the shorthander 'timer' is not initialized after migration. The method init() isn't called in a migrated actor, right? FileReader: A little similar, the variables aren't initialized correclty. FileWriter: It was missing the suffix parameter in 'manage' attributes. Also, after a migration the write_line start to fail because it tries to write a unicode string. So, I tried to convert it to utf-8 before writing in the file.

For the tests, I tried to follow the examples with migration but I put them in another file (it wasn't possible to include them because the original one uses some global variables to save the runtimes). They're not very complicated but fail without the changes.

brunodonassolo commented 7 years ago

Wrong request.

Sorry for the noise.