* [PATCH 5/8] nntp: prefix FD on every log line
2015-09-25 2:27 4% [PATCH 0/8] nntp: more fixes and tiny speedups Eric Wong
@ 2015-09-25 2:27 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-09-25 2:27 UTC (permalink / raw)
To: meta
This can help us track down what request patterns clients
will perform when we have multiple clients.
---
lib/PublicInbox/NNTP.pm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 7e2c2ab..3490a09 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -492,11 +492,12 @@ sub long_response ($$$$) {
my ($self, $beg, $end, $cb) = @_;
die "BUG: nested long response" if $self->{long_res};
+ my $fd = $self->{fd};
+ defined $fd or return;
# make sure we disable reading during a long response,
# clients should not be sending us stuff and making us do more
# work while we are stream a response to them
$self->watch_read(0);
- my $fd = fileno $self->{sock};
my $t0 = now();
$self->{long_res} = sub {
# limit our own running time for fairness with other
@@ -885,10 +886,11 @@ sub event_read {
while ($r > 0 && $self->{rbuf} =~ s/\A\s*([^\r\n]+)\r?\n//) {
my $line = $1;
my $t0 = now();
+ my $fd = $self->{fd};
$r = eval { $self->process_line($line) };
my $d = $self->{long_res} ?
- ' deferred['.fileno($self->{sock}).']' : '';
- out($self, "$line - %0.6f$d", now() - $t0);
+ " deferred[$fd]" : '';
+ out($self, "[$fd] $line - %0.6f$d", now() - $t0);
}
return $self->close if $r < 0;
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/8] nntp: more fixes and tiny speedups
@ 2015-09-25 2:27 4% Eric Wong
2015-09-25 2:27 7% ` [PATCH 5/8] nntp: prefix FD on every log line Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-09-25 2:27 UTC (permalink / raw)
To: meta
Still trying my best to avoid introducing more metadata or Xapian
index overhead to support OVER/XOVER, but it seems futile at this
point.
Eric Wong (8):
nntp: HDR allows metadata prefixed with ':'
nntp: consistently use 501 for unsupported LIST
searchidx: remove unused sub: next_doc_id
nntp: do not repeat result on blocked write
nntp: prefix FD on every log line
git: signal-safety for pipe writes
git: use fields for GitCatFile
nntp: avoid signals for long responses
lib/PublicInbox/GitCatFile.pm | 17 +++++++----------
lib/PublicInbox/NNTP.pm | 30 ++++++++++++++----------------
lib/PublicInbox/SearchIdx.pm | 2 --
3 files changed, 21 insertions(+), 28 deletions(-)
^ permalink raw reply [relevance 4%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-25 2:27 4% [PATCH 0/8] nntp: more fixes and tiny speedups Eric Wong
2015-09-25 2:27 7% ` [PATCH 5/8] nntp: prefix FD on every log line 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).