Project

General

Profile

Bug #86

Multiple subscriptions and/or multireads to the same log don't work

Added by Nitesh Mor almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
gdplogd
Start date:
11/01/2016
Due date:
% Done:

0%


Description

This is a long known bug, but hadn't been reported earlier. Reporting it to make sure everyone is aware of it and duplicated bug-reporting can be avoided.

In a single client program, multiple subscriptions and/or multireads to the same log do not work.

An example program to reproduce is attached (in Python, but similar behavior is observed in C). It starts one thread appending data to a single log, and a number of threads all subscribed to the same log. Example output is shown below, where two threads are subscribed and each of them gets half of the events. Ideally, both of them should get all the events.

$ ./sub.py edu.berkeley.eecs.mor.nov01.01 2 3 10
 0.000027 ## MainThread] logname: edu.berkeley.eecs.mor.nov01.01
 0.000192 ## MainThread] Starting Append Thread
 0.001046 ## MainThread] Starting SThread1
 0.002986 ## MainThread] Starting SThread2
 0.018443 ## SThread2] <gdp.GDP_GCL.GDP_GCL object at 0x7f0e96988f10>
 0.018925 ## SThread1] <gdp.GDP_GCL.GDP_GCL object at 0x7f0e96988f10>
 0.019084 ## AThread] <gdp.GDP_GCL.GDP_GCL object at 0x7f0e96988f10>
 4.019747 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-0" to edu.berkeley.eecs.mor.nov01.01
 4.029345 ## SThread2] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-0" on edu.berkeley.eecs.mor.nov01.01
 5.033138 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-1" to edu.berkeley.eecs.mor.nov01.01
 5.041354 ## SThread1] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-1" on edu.berkeley.eecs.mor.nov01.01
 6.045596 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-2" to edu.berkeley.eecs.mor.nov01.01
 6.053885 ## SThread2] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-2" on edu.berkeley.eecs.mor.nov01.01
 7.058105 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-3" to edu.berkeley.eecs.mor.nov01.01
 7.066408 ## SThread1] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-3" on edu.berkeley.eecs.mor.nov01.01
 8.070576 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-4" to edu.berkeley.eecs.mor.nov01.01
 8.078007 ## SThread2] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-4" on edu.berkeley.eecs.mor.nov01.01
 9.082260 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-5" to edu.berkeley.eecs.mor.nov01.01
 9.090351 ## SThread1] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-5" on edu.berkeley.eecs.mor.nov01.01
10.094745 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-6" to edu.berkeley.eecs.mor.nov01.01
10.103920 ## SThread2] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-6" on edu.berkeley.eecs.mor.nov01.01
11.108260 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-7" to edu.berkeley.eecs.mor.nov01.01
11.116652 ## SThread1] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-7" on edu.berkeley.eecs.mor.nov01.01
12.120698 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-8" to edu.berkeley.eecs.mor.nov01.01
12.128886 ## SThread2] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-8" on edu.berkeley.eecs.mor.nov01.01
13.133071 ## AThread] Appending "edu.berkeley.eecs.mor.nov01.01-AThread-9" to edu.berkeley.eecs.mor.nov01.01
13.141810 ## SThread1] Got data: "edu.berkeley.eecs.mor.nov01.01-AThread-9" on edu.berkeley.eecs.mor.nov01.01

sub.py Magnifier (2.66 KB) Nitesh Mor, 11/01/2016 10:38 AM

History

#1 Updated by Eric Allman almost 4 years ago

  • Category changed from libgdp to gdplogd
  • Status changed from New to Resolved

I believe this should be fixed in commit:029cf007. It turns out it was in gdplogd, not libgdp.

#2 Updated by Nitesh Mor almost 4 years ago

  • Status changed from Resolved to Closed

Seems to work. I can no longer reproduce this bug. Closing.

Also available in: Atom PDF