user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 4/5] search: async_mset: pass resource errors to callback
  2024-04-25 21:31  5% [PATCH 0/5] xap_helper stuff for public daemons Eric Wong
@ 2024-04-25 21:31  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2024-04-25 21:31 UTC (permalink / raw)
  To: meta

We need to be able to handle resource limitation errors in
public-facing daemons.
---
 lib/PublicInbox/Search.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 60d12dbf..b7732ae5 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -469,8 +469,12 @@ sub async_mset {
 	if ($XHC) { # unconditionally retrieving pct + rank for now
 		xdb($self); # populate {nshards}
 		my @margs = ($self->xh_args, xh_opt($opt));
-		my $rd = $XHC->mkreq(undef, 'mset', @margs, $qry_str);
-		PublicInbox::XhcMset->maybe_new($rd, $self, $cb, @args);
+		my $ret = eval {
+			my $rd = $XHC->mkreq(undef, 'mset', @margs, $qry_str);
+			PublicInbox::XhcMset->maybe_new($rd, $self, $cb, @args);
+		};
+		$cb->(@args, undef, $@) if $@;
+		$ret;
 	} else { # synchronous
 		my $mset = $self->mset($qry_str, $opt);
 		$cb->(@args, $mset);

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/5] xap_helper stuff for public daemons
@ 2024-04-25 21:31  5% Eric Wong
  2024-04-25 21:31  7% ` [PATCH 4/5] search: async_mset: pass resource errors to callback Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2024-04-25 21:31 UTC (permalink / raw)
  To: meta

1 and 2 are trivial fixes.

3 and 4 makes failures more graceful when dealing with resource
exhaustion.

5 allows configuring the Xapian helper processes from the
top-level daemon and reverts to disabling helpers by default.

Eric Wong (5):
  t/cindex: require DBD::SQLite for now
  www: mbox*: use Perl 5.12
  send_cmd4: make `tries' a per-call parameter
  search: async_mset: pass resource errors to callback
  daemon: share and allow configuring Xapian helpers

 Documentation/public-inbox-daemon.pod | 38 +++++++++++++++++++++++++--
 Makefile.PL                           |  6 +++++
 lib/PublicInbox/CmdIPC4.pm            | 12 ++++-----
 lib/PublicInbox/Daemon.pm             | 24 +++++++++++++++--
 lib/PublicInbox/Mbox.pm               |  2 +-
 lib/PublicInbox/MboxGz.pm             |  2 +-
 lib/PublicInbox/Search.pm             | 16 ++++++-----
 lib/PublicInbox/Spawn.pm              | 12 +++++----
 lib/PublicInbox/Syscall.pm            |  8 +++---
 lib/PublicInbox/TestCommon.pm         |  9 ++++++-
 lib/PublicInbox/XapClient.pm          |  7 ++---
 t/cindex.t                            |  2 +-
 12 files changed, 106 insertions(+), 32 deletions(-)


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2024-04-25 21:31  5% [PATCH 0/5] xap_helper stuff for public daemons Eric Wong
2024-04-25 21:31  7% ` [PATCH 4/5] search: async_mset: pass resource errors to callback Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).