Work-around:
Create cronjobs that restart the Lemmy container every 6 hours (but not at midnight). The following example is used for a Debian system running Lemmy in Docker.
Type crontab -e into the terminal
Add something like the following:
By restarting the container every 6 hours, outbound federation continues to work. There may still be some delays, but everything gets cleared up regularly.
By telling it what time to restart (0100, 0700, 1300, and 1900 as opposed to "every 6 hours"), it avoids restarting at midnight. This avoids the second bug.
My instance has been doing this for enough days where I'm confident that it's working. You can check your federation status here. Note that it's normal for there to be 0 up-to-date instances and a lot of lagging instances. As long as they sometimes turn "up to date", then everything is getting caught up.
I like to do things just off the top of the hour, since top of the hour is when many maintenance crons run. If you're running a modern cron daemon, you can rewrite that as:
Funnily enough, since I've started to regularly check if my comments made it out I haven't had any problems. Schrödinger's bug.
Edit: Then again, after checking with this post, although my comment made it out just fine, some comments haven't arrived on my instance. I'll try to restart.
Comments from other instances should arrive to yours no problem, as the bug only seems to affect outgoing stuff. If the other instance is running 0.19.0+, then of course those comments might be stuck.