Subject: [PATCH RFC] gdbus: Remove proxies when client disconnects

Remove proxies and generate proxy_removed callbacks even when there are
no corresponding InterfaceRemoved signals.
---
gdbus/client.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/gdbus/client.c b/gdbus/client.c
index f700b7e..d80e252 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -1153,6 +1153,10 @@ static DBusHandlerResult message_filter(DBusConnection *connection,

if (*new == '\0' && client->unique_name != NULL &&
g_str_equal(old, client->unique_name) == TRUE) {
+
+ g_list_free_full(client->proxy_list, proxy_free);
+ client->proxy_list = NULL;
+
if (client->disconn_func)
client->disconn_func(client->dbus_conn,
client->disconn_data);
--
1.8.2.3



Subject: Re: [PATCH RFC] gdbus: Remove proxies when client disconnects

On Wed, May 22, 2013 at 7:35 PM, Anderson Lizardo
<[email protected]> wrote:
> Hi Henrique,
>
> On Wed, May 22, 2013 at 5:54 PM, Henrique Dante de Almeida
> <[email protected]> wrote:
>> Remove proxies and generate proxy_removed callbacks even when there are
>> no corresponding InterfaceRemoved signals.
>> ---
>
> I think that, for the records, it is a good idea to explain on the
> commit message at which circumstances the bug is triggered.

"This patch fixes having zombie gdbus proxy objects when a server
disconnects without sending InterfaceRemoved signals. These objects
may interact with new server instances, for example, making
InterfaceAdded signals of new objects with the same name be filtered
out as duplicates, or staying allocated, but unused if the new server
doesn't reuse the object paths. Note that as a side-effect, the
lifetime of a gdbus proxy becomes stricter: it lives at most for the
duration of a single connection to a single instance of a server
process."

>
> Best Regards,
> --
> Anderson Lizardo
> Instituto Nokia de Tecnologia - INdT
> Manaus - Brazil

2013-05-22 22:35:29

by Anderson Lizardo

[permalink] [raw]
Subject: Re: [PATCH RFC] gdbus: Remove proxies when client disconnects

Hi Henrique,

On Wed, May 22, 2013 at 5:54 PM, Henrique Dante de Almeida
<[email protected]> wrote:
> Remove proxies and generate proxy_removed callbacks even when there are
> no corresponding InterfaceRemoved signals.
> ---

I think that, for the records, it is a good idea to explain on the
commit message at which circumstances the bug is triggered.

Best Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

Subject: Re: [PATCH RFC] gdbus: Remove proxies when client disconnects

On Wed, May 22, 2013 at 6:51 PM, Henrique Dante de Almeida
<[email protected]> wrote:
> Remove proxies and generate proxy_removed callbacks even when there are
> no corresponding InterfaceRemoved signals.
>
> Change-Id: I4fe534cd152f98db00d3462f4d7eaaa41b69bdf3

gerrit hook, sending again

> ---
> gdbus/client.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/gdbus/client.c b/gdbus/client.c
> index f700b7e..d80e252 100644
> --- a/gdbus/client.c
> +++ b/gdbus/client.c
> @@ -1153,6 +1153,10 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
>
> if (*new == '\0' && client->unique_name != NULL &&
> g_str_equal(old, client->unique_name) == TRUE) {
> +
> + g_list_free_full(client->proxy_list, proxy_free);
> + client->proxy_list = NULL;
> +
> if (client->disconn_func)
> client->disconn_func(client->dbus_conn,
> client->disconn_data);
> --
> 1.8.2.3
>