Displaying 16 results from an estimated 16 matches for "connection_worker".
2008 Apr 10
1
Communicating Worker-to-Worker
Hi everyone,
I have two workers, a connection_worker and an interface_worker, that I want
to be able to call methods on each other. Initially I thought I could do
this:
connection_worker
def alive?
return true
end
end
interface_worker
def test_connection
if MiddleMan.worker(:connection_worker).alive?(true)
return true
end...
2017 Dec 02
2
[PATCH nbdkit nbd] nbd: Unsuccessful attempt to fix memory leak.
...loss record 4 of 10
==20307== at 0x4C2FA1E: calloc (vg_replace_malloc.c:711)
==20307== by 0x77EBBAF: ???
==20307== by 0x77EBD17: ???
==20307== by 0x40595C: handle_request (connections.c:894)
==20307== by 0x40595C: recv_request_send_reply (connections.c:1061)
==20307== by 0x405AE7: connection_worker (connections.c:200)
==20307== by 0x55DC55A: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
==20307== by 0x58E85AE: clone (in /usr/lib64/libc-2.26.9000.so)
==20307==
==20307== 320 bytes in 10 blocks are definitely lost in loss record 9 of 10
==20307== at 0x4C2FA1E: calloc (vg_replace...
2020 Aug 05
5
[PATCH NOT WORKING nbdkit 0/3] python: Allow thread model to be set from Python plugins.
...1e640 (LWP 109871)):
#0 0x00007fc4b9d32e5b in __lll_lock_wait_private () from /lib64/libpthread.so.0
#1 0x00007fc4b9d34115 in flockfile () from /lib64/libpthread.so.0
#2 0x000000000040a053 in nbdkit_debug (fs=0x41bada "starting worker thread %s") at debug.c:91
#3 0x00000000004081b7 in connection_worker (data=0x9ee9ff0) at connections.c:116
#4 0x00007fc4b9d293f9 in start_thread () from /lib64/libpthread.so.0
#5 0x00007fc4b9c55b23 in clone () from /lib64/libc.so.6
Thread 8 (Thread 0x7fc4aaa20640 (LWP 109869)):
#0 0x00007fc4b9d32e5b in __lll_lock_wait_private () from /lib64/libpthread.so.0
#1 0...
2019 Nov 02
2
[PATCH nbdkit] server: Use GCC hints to move debug and error handling code out of hot paths.
...< 0)) {
perror ("asprintf");
connection_set_status (conn, -1);
free (worker);
@@ -199,7 +200,7 @@ _handle_single_connection (int sockin, int sockout)
worker->conn = conn;
err = pthread_create (&workers[nworkers], NULL, connection_worker,
worker);
- if (err) {
+ if (unlikely (err)) {
errno = err;
perror ("pthread_create");
connection_set_status (conn, -1);
diff --git a/server/internal.h b/server/internal.h
index 5e11e1a..7e0c375 100644
--- a/server/internal...
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
This fixes the long-standing crash on close when nbdkit exits.
I did try first to fix threads so we're using a proper thread pool,
but that's difficult to implement. So this does the minimal change
needed to fix the crash instead.
There are still two segfaults that happen during running the test
suite. One is deliberately caused (tests/test-captive.sh). The other
appears to be an
2018 Apr 12
3
[PATCH nbdkit 0/2] connections: Protect open and close callbacks with the request lock.
I'm fairly sure that these bugs which appear in the Python plugin:
https://bugzilla.redhat.com/show_bug.cgi?id=1566516
https://bugzilla.redhat.com/show_bug.cgi?id=1566522
are really bugs in the SERIALIZE_ALL_REQUESTS thread model. See
the first patch for the full explanation.
The second patch is a fix for a race condition which is probably
nudged into being by the first patch.
Now this
2017 Dec 02
2
[nbdkit PATCH] nbd: Fix memory leak
When converting from a single transaction to a linked list, I
forgot to free the storage for each member of the list.
Reported-by: Richard W.M. Jones <rjones at redhat.com>
Fixes: 7f5bb9bf13f041ea7702bda557d9dd668bc3423a
Signed-off-by: Eric Blake <eblake at redhat.com>
---
I'm still not sure why 'make check' passes while 'make check-valgrind'
fails for
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do
that, I first need to make nbdkit itself fully parallel ;)
With this series, I was finally able to demonstrate out-of-order
responses when using qemu-io (which is great at sending back-to-back
requests prior to waiting for responses) coupled with the nbd file
plugin (which has a great feature of rdelay and wdelay, to make
it
2017 Dec 02
0
Re: [nbdkit PATCH] nbd: Fix memory leak
...1E: calloc (vg_replace_malloc.c:711)
==18076== by 0x77EBBAF: nbd_request_full (nbd.c:264)
==18076== by 0x77EBD98: nbd_pread (nbd.c:602)
==18076== by 0x405986: handle_request (connections.c:884)
==18076== by 0x405986: recv_request_send_reply (connections.c:1061)
==18076== by 0x405AE7: connection_worker (connections.c:200)
==18076== by 0x55DC55A: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
==18076== by 0x58E85AE: clone (in /usr/lib64/libc-2.26.9000.so)
==18076==
==18076== Invalid read of size 4
==18076== at 0x77EBB11: nbd_reply_raw (nbd.c:340)
==18076== by 0x77EBB11: nbd_read...
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm
confident enough with the series that it should be ready to push;
at any rate, I can now run test-socket-activation in a tight loop
without triggering any crashes or hangs.
With this in place, I'm going back to work on making the nbd
forwarder wort with the parallel thread model.
Eric Blake (8):
sockets: Use
2019 Aug 03
5
[nbdkit PATCH 0/3] More responsive shutdown
We noticed while writing various libnbd tests that when the delay
filter is in use, there are scenarios where we had to resort to
SIGKILL to get rid of nbdkit, because it was non-responsive to SIGINT.
I'm still trying to figure out the best way to add testsuite coverage
of this, but already proved to myself that it works from the command
line, under two scenarios that both used to cause long
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...incoming value. */
-static int
-set_status (struct connection *conn, int value)
+ * For convenience, return the incoming value.
+ */
+int
+connection_set_status (struct connection *conn, int value)
{
if (conn->nworkers)
pthread_mutex_lock (&conn->status_lock);
@@ -150,8 +132,8 @@ connection_worker (void *data)
threadlocal_set_name (name);
free (worker);
- while (!quit && get_status (conn) > 0)
- recv_request_send_reply (conn);
+ while (!quit && connection_get_status (conn) > 0)
+ protocol_recv_request_send_reply (conn);
debug ("exiting worker thr...
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status
implementation. While the patches (especially the second one) are
very large they are really just elementary code motion.
Rich.
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...turn the incoming value.
*/
int
-connection_set_status (struct connection *conn, int value)
+connection_set_status (int value)
{
+ struct connection *conn = GET_CONN;
+
if (conn->nworkers &&
pthread_mutex_lock (&conn->status_lock))
abort ();
@@ -125,8 +128,8 @@ connection_worker (void *data)
threadlocal_set_conn (conn);
free (worker);
- while (!quit && connection_get_status (conn) > 0)
- protocol_recv_request_send_reply (conn);
+ while (!quit && connection_get_status () > 0)
+ protocol_recv_request_send_reply ();
debug ("exitin...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html
v2 replaces
struct connection *conn = GET_CONN;
with
GET_CONN;
which sets conn implicitly and asserts that it is non-NULL.
If we actually want to test if conn is non-NULL or behave
differently, then you must use threadlocal_get_conn() instead,
and some existing uses do that.
Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of
passing around struct connection * entirely within the server,
preferring instead to reference the connection through thread-local
storage.
I hope this is a gateway to simplifying other parts of the code.
Rich.