Skip to content

Fix IRC mirror timeout when relaying messages#917

Open
Grimpper wants to merge 2 commits into
zulip:mainfrom
Grimpper:fix-irc-mirror
Open

Fix IRC mirror timeout when relaying messages#917
Grimpper wants to merge 2 commits into
zulip:mainfrom
Grimpper:fix-irc-mirror

Conversation

@Grimpper
Copy link
Copy Markdown

Fixes: The IRC mirror times out when relaying IRC messages to Zulip due to SSL
socket sharing between parent and child processes after forking with
'mp.Process'.

How did you test this PR?
I've ran the mirror connected to a small IRC room and verified that the messages
where correctly relayed back and forth between the Zulip Cloud Guix instance and
the IRC room. I've used the following command:

./pre-inst-env guix shell python-zulip -- zulip-irc-bridge --irc-server=irc.libera.chat --channel='#lapislazuli' --nick-prefix=irc_mirror --stream='libera.chat IRC' --site='https://guix.zulipchat.com' [email protected] --api-key=$API_KEY
Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

Grimpper added 2 commits May 24, 2026 19:25
* zulip/integrations/bridge_with_irc/irc_mirror_backend.py (fresh_session): New
procedure. Ensure forked processes have a clean client to ensure they don't
share the SSL sockets of the parent.
This change was originally proposed by Sharlatan Hellseher:
https://codeberg.org/guix/guix/pulls/7418#issuecomment-12239616

* zulip/integrations/bridge_with_irc/irc-mirror.py: Rename file to
'irc_mirror.py' to make it importable as a Python module.

* zulip/integrations/bridge_with_irc/irc_mirror.py: Introduce `main' entry point
so it can be used as a setuptools console script entry point.

* zulip/setup.py: Register 'zulip-irc-bridge' as a console script so it's
installed as part of the package output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants