summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Package new snapshotHEADmasterGuido Günther2013-05-29
|
* Use upstream's autogen.shGuido Günther2013-05-29
|
* Remove unused harmattan codeGuido Günther2013-05-29
|
* Disable manpage buildGuido Günther2013-05-28
| | | | since it currently doesn't build
* Add Ove Kaaven Debian packagingGuido Günther2013-05-19
| | | | from http://people.debian.org/~ovek/maemo/
* HACK: Use automake 1.8.5Guido Günther2013-05-19
| | | | as available on maemo
* build: use top_builddir instead of builddirGuido Günther2013-05-18
| | | | | | | when building syncevo-local-sync. Maemo's old automake doesn't now about builddir. This only fixes the one occurence relevant to Maemo.
* build: Split autoreconf optionsGuido Günther2013-05-17
| | | | maemo's Scratchbox autoreconf chokes on the combined ones
* engine: free engine while still protected from signalsPatrick Ohly2013-05-16
| | | | | | | Explicitly free the engine before releasing our lock on shutdown signals. This prevents getting killed by a signal while we are still freeing resources, which can take some time when a background thread is involved (seen in some tests covering that).
* engine: avoid false resending of messages shortly before final timeoutPatrick Ohly2013-05-16
| | | | | | The D-Bus TestHTTP tests occasionally failed because a message was resend due to rounding issues. Be a bit (= 0.1 seconds) more conservative about resending to avoid this.
* PIM testing: fix TestContacts.testDeadAgentPatrick Ohly2013-05-16
| | | | | | | Sometimes an extra "quiescent" signal was seen. It came from the FolksAggregator before reporting any contacts. Not exactly sure why that happens, but because it is not the responsibility of this test to detect that, let's ignore it here.
* PIM testing: sorting test for dePatrick Ohly2013-05-16
| | | | | | The test only passes for Germany. In Austria, ICU itself does not return the results mentioned in Wikipedia. Therefore that test is commented out.
* PIM: select "phonebook" for de and fi (part of FDO #64173)Patrick Ohly2013-05-16
| | | | | | We have to hard code this instead of always using it because ICU does not properly fall back to non-phonebook defaults. Without phonebook as collation, sorting was not done correctly in Germany.
* PIM testing: removed debug printPatrick Ohly2013-05-16
| | | | | The print statement was no longer necessary and actually caused a problem by itself when it failed to print some unicode character.
* PIM: use higher collation levelPatrick Ohly2013-05-16
| | | | | | | Now also pay attention to case and punctuation. Previously these were ignored for performance reasons. The reasoning that case doesn't matter was wrong, it is useful as a tie breaker (which is what the higher level does).
* PIM testing: add tests for Chinese and Japanese sortingPatrick Ohly2013-05-16
| | | | | | | The approach is the same in both cases: - import a certain set of testcases - filter - compare against expected order of results
* PIM: Pinyin sorting for zh languages (part of FDO #64173)Patrick Ohly2013-05-16
| | | | | | | | | | | | | Full interleaving of Pinyin transliterations of Chinese names with Western names can be done by doing an explicit Pinyin transliteration as part of computing the sort keys. This is done using ICU's Transliteration("Han-Latin"), which we have to call directly because boost::locale does not expose that API. We hard-code this behavior for all "zh" languages (as identified by boost::locale), because by default, ICU would sort Pinyin separately from Western names when using the "pinyin" collation.
* PIM: refactor Boost localizationPatrick Ohly2013-05-16
| | | | Move common code in compare classes into CompareBoost.
* PIM: new return value for SyncPeer(), new SyncProgress signal (FDO #63417)Patrick Ohly2013-05-16
| | | | | | | | | The SyncPeer() result is derived from the sync statistics. To have them available, the "sync done" signal must include the SyncReport. Start and end of a sync could already be detected; "modified" signals while a sync runs depends on a new signal inside the SyncContext when switching from one cycle to the next and at the end of the last one.
* glib: stricter ref countingPatrick Ohly2013-05-16
| | | | | | | | | | | | | | | | Following the boost::instrusive_ptr example and making "add_ref = true" the default in our CXX GLib and GObject wrappers led to some memory leaks because it didn't enforce thinking about whether the plain pointer is already owned by us or not. It is better to use a mandatory enum value, ADD_REF and TRANSFER_REF, and force explicit construction. Doing that revealed that the assignment operator was implemented as constructing a CXX instance with increased ref count and/or that in some places, a real leak was caused by increasing the ref count unnecessarily. Running under valgrind gave a false sense of security. Some of the real leaks only showed up randomly in tests.
* SmartPtr: add reset()Patrick Ohly2013-05-16
| | | | | | This mimics the behavior of boost smart pointers and is useful for code where variables can be of either type, because "= NULL" is not supported by our boost::intrusive_ptr wrapper.
* Funambol: avoid testing slow sync modePatrick Ohly2013-05-16
| | | | | | Funambol reacts with a 407 "retry later" very quickly when clients to slow syncs. Avoid that, because it pretty much prevents getting any of the tests to run.
* WebDAV: avoid segfault during collection lookupPatrick Ohly2013-05-16
| | | | | | | | | | | | | | | | Avoid referencing pathProps->second when the set of paths that PROPFINDs returns is empty. Apparently this can happen in combination with Calypso. The stack backtrace sent via email looked like this: Program received signal SIGSEGV, Segmentation fault. 0x4031a1a0 in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::find(std::string const&) const () from /usr/lib/libsyncevolution.so.0 0x4031a1a0 <_ZNKSt8_Rb_treeISsSt4pairIKSsSsESt10_Select1stIS2_ESt4lessISsESaIS2_EE4findERS1_+60>: ldr r4, [r0, #-12] (gdb) bt from /usr/lib/syncevolution/backends/syncdav.so from /usr/lib/syncevolution/backends/syncdav.so from /usr/lib/libsyncevolution.so.0
* PIM: fix for pre-computed normalized phone numbers from EDS (FDO #59571, part 1)Patrick Ohly2013-05-13
| | | | | The method folks_abstract_field_details_get_parameter_values() returns a copy of the values. Must free it, otherwise we leak memory.
* ForkExec: better debug outputPatrick Ohly2013-05-13
| | | | | | | | | | | Include the pid of the child process in all messages relating to it, to help in cases where the same program is started multiple times. Log something in the parent when destroying the fake API instance and thus canceling the fake method call from the child, because that will trigger a "lost connection" message in the child which was hard to correlate with events in the server without those additional log messages in the parent.
* D-Bus testing: remove timeout in TestSessionAPIsDummy.testInteractivePasswordPatrick Ohly2013-05-13
| | | | | The timeout kept firing and showed up in other tests when those timed out, which was very confusing. Had no negative impact otherwise.
* D-Bus testing: implement removal of glib timeoutPatrick Ohly2013-05-13
| | | | | | Use type checking to determine whether a timeout was done via glib or signals. Without removal of a glib timeout, a periodic timeout keeps firing in other tests.
* D-Bus testing: abort server with background threadPatrick Ohly2013-05-13
| | | | | | Ensure that server is currently waiting for background thread, then abort via Session.Abort(). Needs to be detected by backend and the lead to normal session shutdown.
* D-Bus server: activate sessions created for incoming connectionsPatrick Ohly2013-05-13
| | | | | | | Sessions created via the Server.Connect() API were announced via signals, but not activated. Therefore querying their status or aborting them via D-Bus was not possible. Found while writing the TestHTTP.testAbortThread D-Bus test.
* testing: add EDS<->EDS syncing via HTTPPatrick Ohly2013-05-13
| | | | | | | Running EDS on the server side is a relevant use case and may have its own share of problems, in particular when the server runs the EDS code in a background thread. Better test that with libebook and libecal...
* engine: eliminate virtual checkForSuspend/Abort()Patrick Ohly2013-05-13
| | | | | | | | | | Since the introduction of SuspendFlags, the ony remaining user of the virtual aspect of checkForSuspend/checkForAbort() was the testing code. By using the suspend/abort request mechanism in SuspendFlags, it becomes possible to move checkForSuspend/Abort() into SuspendFlags itself. This will be useful to use it outside of a SyncContext member.
* KDE: fix Akonadi backend for tasksDiane Trout2013-05-13
| | | | | Because of a too generic mime type in SyncEvolution, task collections were not found.
* autotools: libsynthesis for SyncEvolution now on freedesktop.orgPatrick Ohly2013-05-13
|
* D-Bus testing: cover implicit URIPatrick Ohly2013-05-13
| | | | | The local source name is the default for the URI value, test that for "calendar".
* D-Bus testing: cover multithreading and HTTPPatrick Ohly2013-05-13
| | | | | | | | | | | | | | | | | test-dbus.py now knows how to start syncevo-http-server. Therefore it can test normal HTTP-based syncing as well as several scenarios which fail or succeed with a slow server depending on the server's ability to send SyncML messages while still initializing the storage. To make the server slow, env variables are checked by the file backend. It may matter whether open() or listAll() are slow, so test both. The tests expecting the 2 minute default must check whether the feature is enabled at all in the binary that they are testing. If not, the test cannot run. All other tests work, albeit somewhat unsafely because they force the engine to run multithreaded when the engine was compiled without mutex locking of global data structures.
* engine: override blocking threading code in libsynthesisPatrick Ohly2013-05-13
| | | | | | | | | | | | | | | We need to keep the glib event loop running while the main thread waits for the background thread to finish. Otherwise code using glib events (like EDS) may get stuck (observed with Sleep() when using g_timeout_add() and synchronous calls in EDS 3.6). We also need to watch for abort requests. When aborted, we give up waiting for the thread and tell the engine to proceed. This will eventually return control to us, where we can shut down. When libsynthesis shuts down, it'll wait forever for the background thread's shutdown. In this case we must wait and hope that the background thread completes or aborts by itself.
* engine: prevent timeouts in HTTP server modePatrick Ohly2013-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | HTTP SyncML clients give up after a certain timeout (SyncEvolution after RetryDuration = 5 minutes by default, Nokia e51 after 15 minutes) when the server fails to respond. This can happen with SyncEvolution as server when it uses a slow storage with many items, for example via WebDAV. In the case of slow session startup, multithreading is now used to run the storage initializing in parallel to sending regular "keep-alive" SyncML replies to the client. By default, these replies are sent every 2 minutes. This can be configured with another extensions of the SyncMLVersion property: SyncMLVersion = REQUESTMAXTIME=5m Other modes do not use multithreading by default, but it can be enabled by setting REQUESTMAXTIME explicitly. It can be disabled by setting the time to zero. The new feature depends on a libsynthesis with multithreading enabled and glib >= 2.32.0, which is necessary to make SyncEvolution itself thread-safe. With an older glib, multithreading is disabled, but can be enabled as a stop-gap measure by setting REQUESTMAXTIME explicitly.
* engine: event processing when using multithreadingPatrick Ohly2013-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only one thread may handle events in the default context at any point in time. If a second thread calls g_main_context_iteration() or g_main_loop_run(), it blocks until the other thread releases ownership of the context. In that case, the first thread may wake up because of an event that the second thread waits for, in which case the second thread may never wake up. See https://mail.gnome.org/archives/gtk-list/2013-April/msg00040.html This means that SyncEvolution can no longer rely on these functions outside of the main thread. This affects Sleep() and the EDS backend. As an interim solution, take over permanent ownership of the default context in the main thread. This prevents fights over the ownership when the main thread enters and leaves the main loop repeatedly. Utility code using the main context must check for ownership first and fall back to some other means when not the owner. The assumption for the fallback is that the main thread will drive the event loop, so polling with small delays for the expected status change (like "view complete" in the EDS backend) is going to succeed eventually. A better solution would be to have one thread running the event loop permanently and push all event handling into that thread. There is C++ utility code for such things in: http://cxx-gtk-utils.sourceforge.net/2.0/index.html See in particular the TaskManager class and its make_task_when()/make_task_compose()/make_task_when_full() functions for executing asynchronous results via a glib main loop, also the Future::when() method and a number of other similar things in the library.
* D-Bus testing: improved running of command line toolPatrick Ohly2013-05-13
| | | | | | | | | | | | | | | | | | | Refactored the code into a new utility base class for use in other tests. Replace pipes with temporary files, using the same base name as the traditional .syncevo.log and .dbus.log. They are numbered (because the command line might be run multiple times per test) and use .out, .err, or .outerr as suffix depending on what kind of output they contain. The advantage is that the output gets recorded permanently. Use that when waiting for command completion times out: in that case, the content of the output file(s) gets added to the exception. The subprocess handle returned by startCmdline() is extended with information about output redirection that is then used by finishCmdline(). This makes one parameter of finishCmdline() redundant.
* engine: clarify m_remoteInitiatedPatrick Ohly2013-05-13
| | | | | | It means "the remote was initiated", not "we were initiated by the remote side". Somewhat unfortunate choice of a variable name, but leave it for now...
* engine: better transport timeout handlingPatrick Ohly2013-05-13
| | | | | | | | | | | | Use the monotonic system time. Timespec has sub-second resolution and by using the monotonic time, we are independent of time corrections. If retryDuration is smaller than retryInterval, then time out after retryDuration instead of waiting once for retryInterval and then checking retryDuration. When the request timed out *exactly* after retryDuration or the next resend would happen after the retryDuration, then give up immediately.
* Google: ignore loss of TRANSP propertyPatrick Ohly2013-05-13
| | | | | Google Calendar currently drops the TRANSP property. This is a regression that was reported to Google. While waiting for a fix ignore the problem.
* D-Bus: fix random session failuresPatrick Ohly2013-05-13
| | | | | | | | | | When the helper shuts down normally after the parent is done with it, there was a race between handling the signal and the loss of connection, leading to random "return 1" errors. This showed up in nightly testing in particular in the test-dbus.py testConfigure. The loss of connection at that point is not an error, so don't treat it as one and simply return 0.
* D-Bus: add helper's stdout to parent's stdoutPatrick Ohly2013-05-13
| | | | | | | | | | During normal operation, the helper's messages were never printed to any output stream. They only went out via D-Bus. This was surprising when debugging syncevo-dbus-server and it's interaction with syncevo-dbus-helper. It's better to let the parent print the helper's output if the helper doesn't do it itself, so that console output is the same with and without SYNCEVOLUTION_DEBUG.
* D-Bus: fix shutdown race condition after aborted syncPatrick Ohly2013-05-13
| | | | | | | | | | | | | | | | When a sync in syncevo-dbus-helper was aborted, the process did not wait in main() for the server to acknowledge the D-Bus method response. If the process quit to early, the parent did not get the method response, leading to an "internal error" instead of "aborted" as result of the sync. The reason is that the acknowledgement was meant to be done via SIGTERM, but that had already been sent and thus syncevo-dbus-helper did not wait. Solved by using SIGURG for the acknowledgement. In addition, the parent must not close its connection when sending signals to the child, because the child may still need to send its sync report and/or log output signals.
* D-Bus: fix syncevo-dbus-server<->syncevo-dbus-helper communication when ↵Patrick Ohly2013-05-13
| | | | | | | | | | | | | | | | | | | using GIO D-Bus D-Bus objects in a process exist independently from a specific D-Bus connection. They are only identified by their path. When syncevo-dbus-server forked multiple syncevo-dbus-helper instances, it indirectly (in ForkExec) created multiple callback objects for the childs "watch" functionality (a pending method call that the parent never replies to). These method calls were associated with the a random (oldest?) session instead of the current one. This causes problems once an older session terminates and the callback object destructs, because then the wrong children get a failure response, which they treat as "connection lost = parent has terminated". Found while trying to fix shutdown race conditions. The solution is to generate a unique counter for each child and communicate that counter to the child via a new env variable.
* engine: support additional signals in SuspendFlagsPatrick Ohly2013-05-06
| | | | | | | | | | | | | | | | | | | It can be useful to use additional signals like SIGURG or SIGIO (typically not used elsewhere) for simple interprocess communication. SuspendFlags now supports that by letting the process catch more than just SIGINT and SIGTERM and recording which signals were received. activate() calls can happen when already active, for example when syncevo-dbus-helper instantiates SyncContext, which activates signal handling for the duration of the sync. This was not handled well before, leaking previously allocated FDs and not restoring signal handlers correctly. Because the process quit anyway soon, this did not matter in practice. Now the code explicitly checks for this and returns the existing Guard in all following activate() calls, without changing the signal handling.
* Logging: thread-safePatrick Ohly2013-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging must be thread-safe, because the glib log callback may be called from arbitrary threads. This becomes more important with EDS 3.8, because it shifts the execution of synchronous calls into threads. Thread-safe logging will also be required for running the Synthesis engine multithreaded, to overlap SyncML client communication with preparing the sources. To achieve this, the core Logging module protects its global data with a recursive mutex. A recursive mutes is used because logging calls themselves may be recursive, so ensuring single-lock semantic would be hard. Ref-counted boost pointers are used to track usage of Logger instances. This allows removal of an instance from the logging stack while it may still be in use. Destruction then will be delayed until the last user of the instance drops it. The instance itself must be prepared to handle this. The Logging mutex is available to users of the Logging module. Code which holds the logging mutex should not lock any other mutex, to avoid deadlocks. The new code is a bit fuzzy on that, because it calls other modules (glib, Synthesis engine) while holding the mutex. If that becomes a problem, then the mutex can be unlocked, at the risk of leading to reordered log messages in different channels (see ServerLogger). Making all loggers follow the new rules uses different approaches. Loggers like the one in the local transport child which use a parent logger and an additional ref-counted class like the D-Bus helper keep a weak reference to the helper and lock it before use. If it is gone already, the second logging part is skipped. This is the recommended approach. In cases where introducing ref-counting for the second class would have been too intrusive (Server and SessionHelper), a fake boost::shared_ptr without a destructor is used as an intermediate step towards the recommended approach. To avoid race conditions while the instance these fake pointers refer to destructs, an explicit "remove()" method is necessary which must hold the Logging mutex. Using the potentially removed pointer must do the same. Such fake ref-counted Loggers cannot be used as parent logger of other loggers, because then remove() would not be able to drop the last reference to the fake boost::shared_ptr. Loggers with fake boost::shared_ptr must keep a strong reference, because no-one else does. The goal is to turn this into weak references eventually. LogDir must protect concurrent access to m_report and the Synthesis engine. The LogRedirectLogger assumes that it is still the active logger while disabling itself. The remove() callback method will always be invoked before removing a logger from the stack.
* Logging: merge Logger and LoggerBasePatrick Ohly2013-05-06
| | | | | Having two separate classes had little (no?!) benefit and just caused confusion.
* Logging: remove obsolete isProcessSafe()Patrick Ohly2013-05-06
| | | | | | The method became obsolete when introducing fork+exec for local syncing. Before that, the method was used to remove unsafe loggers in the child's process. Now exec() does that for us.