]> Sergey Matveev's repositories - public-inbox.git/commitdiff
solver: crank up max patches to 9999
authorEric Wong <e@80x24.org>
Sun, 27 Jan 2019 03:38:41 +0000 (03:38 +0000)
committerEric Wong <e@80x24.org>
Sun, 27 Jan 2019 03:44:40 +0000 (03:44 +0000)
Might as well, since the only constraint is filesystem space
for temporary files for public-inbox-httpd users.

-httpd can fairly share work across clients with our use of
psgi_qx; and there's a recent patch series in git@vger with 64
patches in sequence.

lib/PublicInbox/SolverGit.pm

index dfc28d260c7c490c1f271f25a21bc3a7dc8dd107..39acbe414285f3410d727873844734191e635911 100644 (file)
@@ -24,6 +24,14 @@ use URI::Escape qw(uri_escape_utf8);
 use POSIX qw(sysconf _SC_ARG_MAX);
 my $ARG_SIZE_MAX = (sysconf(_SC_ARG_MAX) || 4096) - 2048;
 
+# By default, "git format-patch" generates filenames with a four-digit
+# prefix, so that means 9999 patch series are OK, right? :>
+# Maybe we can make this configurable, main concern is disk space overhead
+# for uncompressed patch fragments.  Aside from space, public-inbox-httpd
+# is otherwise unaffected by having many patches, here, as it can share
+# work fairly.  Other PSGI servers may have trouble, though.
+my $MAX_PATCH = 9999;
+
 # di = diff info / a hashref with information about a diff ($di):
 # {
 #      oid_a => abbreviated pre-image oid,
@@ -425,7 +433,7 @@ sub di_url ($$) {
 sub resolve_patch ($$) {
        my ($self, $want) = @_;
 
-       if (scalar(@{$self->{patches}}) > $self->{max_patch}) {
+       if (scalar(@{$self->{patches}}) > $MAX_PATCH) {
                die "Aborting, too many steps to $self->{oid_want}";
        }
 
@@ -477,7 +485,6 @@ sub new {
        bless {
                gits => $ibx->{-repo_objs},
                user_cb => $user_cb,
-               max_patch => 100,
 
                # TODO: config option for searching related inboxes
                inboxes => [ $ibx ],