<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/server, branch langdale</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=langdale</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=langdale'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2023-01-16T11:08:39+00:00</updated>
<entry>
<title>bitbake: server/process: Add bitbake.sock race handling</title>
<updated>2023-01-16T11:08:39+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-01-14T14:12:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=da318dd088a3573e3abefdf14ea9b8bfecf36e3c'/>
<id>urn:sha1:da318dd088a3573e3abefdf14ea9b8bfecf36e3c</id>
<content type='text'>
We've seen cases where the bitbake.sock file appears to disappear but the
server continues to hold bitbake.lock. The most likely explaination is
that some previous build directory was moved out the way, a server there
kept running, eventually exited and removed the sock file from the wrong
directory.

To guard against this, save the inode information for the sock file and check
it before deleting the file. The new code isn't entirely race free but should
guard against what is a rare but annoying potential issue.

(Bitbake rev: 52b6b099a47555811b8d0b311f62af712dd6eb8e)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit b02ebbffdae27e564450446bf84c4e98d094ee4a)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: process: log odd unlink events with bitbake.sock</title>
<updated>2023-01-16T11:08:39+00:00</updated>
<author>
<name>Frank de Brabander</name>
<email>debrabander@gmail.com</email>
</author>
<published>2023-01-14T14:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bfa114bfa8040f38c247bb0d38f5aeee3595e819'/>
<id>urn:sha1:bfa114bfa8040f38c247bb0d38f5aeee3595e819</id>
<content type='text'>
Log when the socket file already exists and is removed before
recreating a new socket.

Log when unlinking the socket file failed.

(Bitbake rev: 9779fad4d9e2540b24bb91cfa38fc1984402bef2)

Signed-off-by: Frank de Brabander &lt;debrabander@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit cfd7c9899f988bab6d9fe7bbfbdb60603fb5ed34)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Fix logging issues where only the first message was displayed</title>
<updated>2022-06-25T20:14:07+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-06-24T21:54:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4a241d0cfb57c63e366ba4e355102ad9a97192e1'/>
<id>urn:sha1:4a241d0cfb57c63e366ba4e355102ad9a97192e1</id>
<content type='text'>
I realised only the first logging message was being displayed in a given
parsing process. The reason turned out to be the UI handler failing
with a "pop from empty list". The default handler was then lost and
no further messages were processed.

Fix this by catching the exception correctly in the connection writer code.

(Bitbake rev: d3e64f64525187f1409531a0bd99df576e627f7f)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Avoid tracebacks at exit</title>
<updated>2022-06-10T12:40:02+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-06-10T12:38:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6c9a516e7617e3f82de4540515c57b33508454fc'/>
<id>urn:sha1:6c9a516e7617e3f82de4540515c57b33508454fc</id>
<content type='text'>
In theory this should have been worked around but is still occurring. Add
it to the list of things to ignore when bitbake is shutting down.

Traceback (most recent call last):
  File "/usr/lib64/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/server/process.py", line 698, in startCallbackHandler
    event = self.reader.get()
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/server/process.py", line 722, in get
    res = self.reader.recv_bytes()
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 221, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 426, in _recv_bytes
    return self._recv(size)
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 384, in _recv
    chunk = read(handle, remaining)
TypeError: an integer is required (got type NoneType)'

(Bitbake rev: 7a28ac4fe478bee1e52e84412da9626495f9c6c7)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Remove daemonic thread usage</title>
<updated>2022-06-08T20:53:15+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-06-07T13:58:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ce592bc9ac9c503176699b96ae4340f1b9b9bedc'/>
<id>urn:sha1:ce592bc9ac9c503176699b96ae4340f1b9b9bedc</id>
<content type='text'>
We're seeing UI deadlocks occasionally and this is possibly due to the
use of a daemonic thread in the UI event queue processing. This thread
could terminate holding a threading Lock() which would cause issues
for the process when exitting.

Change the shutdown process to handle this more cleanly.

(Bitbake rev: f5ad8349a5dbff9824a89f5708cfd011d61888c9)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Avoid risk of exception deadlocks</title>
<updated>2022-06-08T20:53:15+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-06-07T13:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=5940020cfb721d79111072b3cd5d581fff59561b'/>
<id>urn:sha1:5940020cfb721d79111072b3cd5d581fff59561b</id>
<content type='text'>
The open coded lock acquire/release in the UI event handler doesn't
cover the case an exception occurs and if one did, it could deadlock
the code. Switch to use 'with' statements which would handle this
possibility.

We have seen deadlocks in the UI at exit this so this removes a
possible cause.

(Bitbake rev: bd12792f28efd2f03510653ec947ebf961315272)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Drop unused import</title>
<updated>2022-04-21T20:00:35+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-04-20T13:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a2e0ed2cbf5525a6389748413b235ca79b4ffb0e'/>
<id>urn:sha1:a2e0ed2cbf5525a6389748413b235ca79b4ffb0e</id>
<content type='text'>
(Bitbake rev: 543315e6463f15ca7ab2b4ef3e8ed41bb4207ccf)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Disable gc around critical section</title>
<updated>2022-04-03T16:51:26+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-04-02T08:46:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00'/>
<id>urn:sha1:496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00</id>
<content type='text'>
The python gc can trigger whilst we're holding the event stream lock
and when cleaning up objects, they can trigger warnings. This translates
into a new event which would then need the lock and we can deadlock.

Disable gc whilst we hold that lock to avoid this unfortunate and
problematic situation.

(Bitbake rev: 96a6303949cefd469bcf5ed250ff512271354357)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: cooker/process: Fix signal handling lockups</title>
<updated>2022-03-30T12:05:03+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-03-29T14:17:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=928bcb10a46939eaf801bea0b633e4624b5b5dfa'/>
<id>urn:sha1:928bcb10a46939eaf801bea0b633e4624b5b5dfa</id>
<content type='text'>
If a parser process is terminated while holding a write lock, then it
will lead to a deadlock (see
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.terminate).

With SIGTERM, we don't want to terminate holding the lock. We also don't
want a SIGINT to cause a partial write to the event stream.

I tried using signal masks to avoid this but it doesn't work, see
https://bugs.python.org/issue47139

Instead, add a signal handler and catch the calls around the critical section.
We also need a thread lock to ensure other threads in the same process don't
handle the signal until all the threads are not in the lock.

(Bitbake rev: a40efaa5556a188dfe46c8d060adde37dc400dcd)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Correct a typo in a comment</title>
<updated>2022-03-28T12:33:28+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2022-03-26T18:39:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=279e754d86eca3c5db6edb7f5bd170ba7712ca94'/>
<id>urn:sha1:279e754d86eca3c5db6edb7f5bd170ba7712ca94</id>
<content type='text'>
(Bitbake rev: b4a157b2fe2fb481ffa40e0f32659d05dd6320c2)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
