diff mbox series

[1/4] asyncrpc: Avoid file not found traceback in logs

Message ID 20250716152249.96126-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit a7e1a07e9ef7e6f6a1bcaf567d7916a8ee1ef087
Headers show
Series [1/4] asyncrpc: Avoid file not found traceback in logs | expand

Commit Message

Richard Purdie July 16, 2025, 3:22 p.m. UTC
If the server is quickly stopped, we see tracebacks in the locks
due to the file not existing. Hide these as they're not errors.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/asyncrpc/serv.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Joshua Watt July 17, 2025, 3:20 p.m. UTC | #1
LGTM

Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>

On Wed, Jul 16, 2025 at 9:22 AM Richard Purdie via
lists.openembedded.org
<richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
>
> If the server is quickly stopped, we see tracebacks in the locks
> due to the file not existing. Hide these as they're not errors.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  lib/bb/asyncrpc/serv.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/bb/asyncrpc/serv.py b/lib/bb/asyncrpc/serv.py
> index 667217c5c1b..35e93f7c969 100644
> --- a/lib/bb/asyncrpc/serv.py
> +++ b/lib/bb/asyncrpc/serv.py
> @@ -211,7 +211,10 @@ class UnixStreamServer(StreamServer):
>          self.server.close()
>
>      def cleanup(self):
> -        os.unlink(self.path)
> +        try:
> +            os.unlink(self.path)
> +        except FileNotFoundError:
> +            pass
>
>
>  class WebsocketsServer(object):
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#17779): https://lists.openembedded.org/g/bitbake-devel/message/17779
> Mute This Topic: https://lists.openembedded.org/mt/114186786/3616693
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [JPEWhacker@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/lib/bb/asyncrpc/serv.py b/lib/bb/asyncrpc/serv.py
index 667217c5c1b..35e93f7c969 100644
--- a/lib/bb/asyncrpc/serv.py
+++ b/lib/bb/asyncrpc/serv.py
@@ -211,7 +211,10 @@  class UnixStreamServer(StreamServer):
         self.server.close()
 
     def cleanup(self):
-        os.unlink(self.path)
+        try:
+            os.unlink(self.path)
+        except FileNotFoundError:
+            pass
 
 
 class WebsocketsServer(object):