This effort consists of three major tasks:
* A standalone Saros server program which allows users to create or join a single session and share projects. At a minimum, changes to files should be synchronized between participants as in a classic host-based session. Some advanced Saros features might not work yet. * ?
TODO
Milestone no. | Past | CW | Goals | accomplished | |
---|---|---|---|---|---|
1 | Project sharing by non-hosts | yes (patch #2264) | |||
2 | 35 | SarosSessionManager in core | no (last refactorings missing) |
SarosSession
and
SarosSessionManger
to the core.
SarosSession
to
the core, with more changes still needed than originally thought. Some of
these patches still need work or need to replaced with different approaches
until everything can be merged, but some patches already made their way
into master.
The goal of moving SarosSessionManager
to the core has not
been fully met; this work has to be continued and completed next week.
Pushed Patches:
SarosSessionTest
needs to be decided (see
#2852). It is
more or Eclipse-specific integration test for session startup, thus
cannot easily be moved to the core together with
SarosSession
. A possible approach might be to simply
remove this test class and write a much simpler
SarosSessionTest
for the core.
SarosSessionManager
to the core
IPath
IPath
interface
SarosSessionManager
is now
essentially done (except for possible work needed on the patches in
review). There is the start of an IPath
implementation
(#2867),
but there are still several interfaces to implement until there is a
complete core implementation of the Saros filesystem interfaces.
Pushed Patches:
None this week.
IPath
implementation and continue implementing further filesystem interfaces
IPath
implementation based on java.nio.Path
SarosSessionManager
's move to the core is now merely waiting
for an approval of #2852.
Stefan gave a +1 to the patch, but due to Franz' early objections to the patch,
I am holding off the merge for now until this has been discussed.
The server now has an (so far empty) Eclipse project. I have set the project
to require Java 7 as this allows me to make use of the
java.nio.file
API, which will greatly simplify the implementation of the Saros filesystem
interfaces. I already reaped the benefits of this decision by replacing
the IPath
implementation I started last week with one wrapping
java.nio.file.Path;
the result is smaller and at the same time more complete and robust than the
previous approach.
New Patches:
I am still asking myself how to best write the server's Ant build file for CI, as well as how the CI integration actually happens. Will ask Stefan and Franz about this.
The slidedeck for the kickoff presentation is now complete. Unfortunately, I was not able to push any code changes this week.
We decided that #2852 can be abandoned alltogether.None.
IPath
and IResource
implementations
IResource
(not pushed yet)
IPath
(#2877)
was slightly revised. I also implemented most of the methods of
IResource
locally (excluding those that need to be implemented
per-resource-type), but didn't create a patch for the code yet because it
requires two additions to the filesystem interfaces -
IResource#getLocation
and IPath#segment
- so I
pushed those first. ServerResourceImpl
will be pushed as soon
as those two patches have been merged. (I am not able to push it earlier
because I cannot rebase it on top of the interface commits and the build
file patch.)
The patch to move SarosSessionManager
to the core was not merged yet
because Stefan noted that LeaveAndKickHandler
needs to be moved
first. This class has a dependency on the Eclipse-specific SarosView
class that needs to be removed. I pushed #2902
to prepare for this.
New Patches:
LeaveAndKickHandler
is moved
None.
IResource
implementation
IResource
implementation for review
IFile
IResource
implementation
(#2904) and a draft
for an implementation of IFile
(#2907).
New Patches:
None.
IFile
implementation
Most filesystem interfaces are implemented now (see new patches). Only IWorkspace is still missing.
Regarding the setup of SonarQube for the server, I found out that changes on the SonarQube admin interface are likely needed. Franz will provide me with SSH access to the Saros build server so that I can expose the admin interface and do any required changes. New Patches:None.
IWorkspace
I started work on getting the server running. The goal here is to quickly get to a state where a working server session is possible, create a big draft patch, and then revise and break out master-worthy patches piece by piece.
So far I cherry-picked some in-review patches (such as the one movingSarosSessionManager
to the core), implemented a few more
core interfaces and wrote a simple main class. I have reached the
point where the server is able to start, successfully connect to the
XMPP network and advertise itself as a Saros server; however, the
session creation process still hangs for reasons that still need to be
investigated.
New Patches:
None.
INegotiationHandler
server implementation which blocked
the message receiver thread and thus made it impossible for
negotiations code to receive messages, as well as a faulty
UISynchronizer
implementation which blocked on nested
syncExec()
calls), I was able to successfully create a
server session and add projects to it from an Eclipse with
patch #2602
applied.
However, when I do changes to a project after adding it, these changes
are not applied to the server. It turned out that all code that
consumes the activities and acts upon them is located in the Saros/E
and Saros/I sources and is IDE-specific. I thus need to write
server-specific AbstractActivityConsumer
implementations
which apply activities to the server's local workspace.
None.
IEditorManager
which caches the text
content of recently changed files to reduce disk I/O. (Batched writing
of changes could avoid even more I/O; right now, every text edit by a
client is immediately saved to disk.)
I took all of the code I have written for the server and uploaded it as [[http://saros-build.imp.fu-berlin.de/gerrit/2929][#2929 ("the huge server patch")]]. This patch also includes all changes of the patches it is based on, but which are not yet merged into master (such as the server-specific filesystem interface implementations). This patch is not intended for merging, but only for testing the server in its current state.
Besides this, I got annoyed by the large amount of warnings seen in the Eclipse Problems and took the time to create a few patches that fix some classes of them (e.g., "empty block need comment" warnings). Together, these patches should decrease the warning count by about 150.
New Patches:None.
Now Sonarqube works in general, but the analysis crashes for the huge server patch for unknown reasons, probably in a checker when analyzing a specific section of the code. Franz and I agreed to just wait until one of the extracted small patches causes the same crash, then debug the issue there.
Speaking of extracted patches, I succeded in extracting theUISynchronizer
implementation from the huge server patch
and push it as a separate one which also includes unit tests. It took
a while to find out a nice way to split a commit into two pieces, but
after a bit of Googling and practice I know feel that I can easily
repeat this procedure for future patch extractions.
New Patches:
Changes to Existing Patches:
Except for the Sonarqube crash issue explained in the previous section, none.
For the planned server stress test, I looked at how to write tests with the STF framwork. Thankfully, the process looks very simple. What was mising was a possiblity to join a server session rather than creating one as the host and inviting others. I added a method to the framework to do this, which was surprisingly simple.
Other than that, I found a serious problem in the huge server patch: the server would not route activities it received from one client to the others. After quite a bit of debugging, I found out that theSharedProjectMapper
used IProject
instances
as hash keys and thus expected equals()
and
hashCode()
to be implemented. Because this wasn't the
case in the server implementation, the code couldn't find the list of
shared files for any project and thus concluded that no file was
currently shared; as a result, no activities were sent on the server
side. This problem is now fixed in the newest patch set and will be
split out into a smaller patch later.
I didn't continue extracting patches out of the huge server patch because there are enough pending server patches already that need merging. I will concentrate on getting these merged before extracting new ones.
Changes to Existing Patches:None.
LeaveAndKickHandler
to core
SarosServer
launch
configuration which passes usable defaults for these options. Last but
not least, I added a component which listens for and applies
FolderActivity
s in addition to FileActivity
s.
In order to remove the last blocker for a merge of the
SarosSessionManager
-to-core patch, I created a set of
three patches which move LeaveAndKickHandler
to the core.
While at it, I resolved the class' FIXME comment by refactoring the
handler into a session component.
While starting to complete the stress test for the server, I noticed
that if two clients continuously edit the same text file during a
server session, their file versions begin to diverge after a while.
Even more strangely, this problem only occurs on Windows. I suspected
that the problem is file-system-related, so I commented out the code
that saves received text edits to disk in
ServerEditorManagerImpl
; the problem disappeared. (If the
saving is replaced with Thread.sleep(1000)
, the problem
still doesn't appear, so it doesn't seem to be a pure timing problem.)
Further digging revealed that I implemented the
setContents()
of ServerFileImpl
naively, by
writing the new contents to the file directly. This is fragile because
the write isn't atomic. On Windows, it has the additional disadvantage
of locking the file during the write. I changed the code to write the
new contents to a temporary file instead, then move that file
atomically to the correct destination. (This is how saving is
implemented in most text editors.) This caused the problem to
disappear completely. It still bugs me that I don't know exactly what
the problem was, but as this change was needed anywhere, I guess it's
fine.
New Patches:
Now that the strange server session bug has been fixed, none.
I met with Holger to work on the Saros Gerrit CI job (now named Saros-Full-Gerrit). This job is configured to use Java 6, but the server and now Saros-IntelliJ require Java 7. The solution was to create subprojects for these two (Saros-Server-Gerrit and Saros-IntelliJ-Gerrit) and call them from Saros-Full-Gerrit. We were then configure the subprojects to use Java 7.
Stefan found another problem with theSarosSessionManager
patch. There were three packet handlers left in Saros/I which were
duplicating work of NegotiationPacketListener
, a class
which is being moved together with SarosSessionManager
in
the same patch. I updated the patch to remove the obsolete handlers.
I didn't accomplish much else this week, unfortunately, other than writing a little bit on the master thesis.
Changes to Existing Patches:None.
I continued black-box evaluation of the server by writing a second stress test. Instead of concurrente text edits, this one continuously logs into a server session and leaves it again. Like the test before it, this one didn't expose any memory leaks or other metrics. I will probably continue writing one or two other tests.
TheSarosSessionManager
patch is finally merged. Yay!
It's in the core now.
Other than that, this week was mostly about writing my thesis.
Changes to Existing Patches:None.
While writing my master thesis about the non-host project negotiation I implemented with Ute Neise many months ago, I double-checked if the code handles all use cases (e.g. editing while the project archive is being sent) it was supposed to handle. Unfortunately, I found out that the patch doesn't handle them, although I was sure I did (I rebased the patch multiple times since - maybe I was sloppy and broke something …). With my much-grown-over-the-months knowledge of the Saros internals, I spent half a day's work to greatly improve the patch and make it much smaller as well. Now the edge cases are handled without data loss as expected, and the host even doesn't have to share projects with the non-host it just received them from, as was the case before. Success!
Other than that, I continued writing my thesis.
Changes to Existing Patches:None.