* [PATCH 0/2] www: improve handling of missing coderepos
@ 2024-05-24 0:56 Eric Wong
2024-05-24 0:56 ` [PATCH 1/2] git: don't break from event loop if cat-file fails Eric Wong
2024-05-24 0:56 ` [PATCH 2/2] www_coderepo: improve handling of broken repos Eric Wong
0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-24 0:56 UTC (permalink / raw)
To: meta
This all needs to be made more robust and tested later.
But fix some of the problems I've seen in syslog for now
and hope I feel better in a few days.
Eric Wong (2):
git: don't break from event loop if cat-file fails
www_coderepo: improve handling of broken repos
lib/PublicInbox/Git.pm | 3 ++-
lib/PublicInbox/WwwCoderepo.pm | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] git: don't break from event loop if cat-file fails
2024-05-24 0:56 [PATCH 0/2] www: improve handling of missing coderepos Eric Wong
@ 2024-05-24 0:56 ` Eric Wong
2024-05-24 0:56 ` [PATCH 2/2] www_coderepo: improve handling of broken repos Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-24 0:56 UTC (permalink / raw)
To: meta
`git cat-file' can OOM or fail by other means. Don't let it
bring down the event loop with an uncaught exception.
---
lib/PublicInbox/Git.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index a9a821ad..ff38efa1 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -639,7 +639,8 @@ sub event_step {
my ($self) = @_;
my $inflight = gcf_inflight($self);
if ($inflight && @$inflight) {
- $self->cat_async_step($inflight);
+ eval { $self->cat_async_step($inflight) };
+ warn "E: $self->{git_dir}: $@" if $@;
return $self->close unless $self->{sock};
# don't loop here to keep things fair, but we must requeue
# if there's already-read data in pi_io_rbuf
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] www_coderepo: improve handling of broken repos
2024-05-24 0:56 [PATCH 0/2] www: improve handling of missing coderepos Eric Wong
2024-05-24 0:56 ` [PATCH 1/2] git: don't break from event loop if cat-file fails Eric Wong
@ 2024-05-24 0:56 ` Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-24 0:56 UTC (permalink / raw)
To: meta
The {readme} arrayref may be completely unset if a repo goes
missing, so account for that when the summary page runs.
---
lib/PublicInbox/WwwCoderepo.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm
index a5e2dc4a..8587f530 100644
--- a/lib/PublicInbox/WwwCoderepo.pm
+++ b/lib/PublicInbox/WwwCoderepo.pm
@@ -186,7 +186,7 @@ EOM
print $zfh "...\n" if $last;
# README
- my ($bref, $oid, $ref_path) = @{delete $ctx->{qx_res}->{readme}};
+ my ($bref, $oid, $ref_path) = @{delete $ctx->{qx_res}->{readme} // []};
if ($bref) {
my $l = PublicInbox::Linkify->new;
$$bref =~ s/\s*\z//sm;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-24 0:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24 0:56 [PATCH 0/2] www: improve handling of missing coderepos Eric Wong
2024-05-24 0:56 ` [PATCH 1/2] git: don't break from event loop if cat-file fails Eric Wong
2024-05-24 0:56 ` [PATCH 2/2] www_coderepo: improve handling of broken repos Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).