• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 12178254343

05 Dec 2024 10:51AM UTC coverage: 64.385% (-0.3%) from 64.734%
12178254343

push

github

web-flow
Merge pull request #14934 from omoerbeek/gh-action-build-name

GH workflow for building packages: change name so target isn't chopped off

37416 of 88740 branches covered (42.16%)

Branch coverage included in aggregate %.

125826 of 164800 relevant lines covered (76.35%)

3849962.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

34.15
/pdns/recursordist/taskqueue.cc
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#include "taskqueue.hh"
24

25
#include "logging.hh"
26
#include "syncres.hh"
27

28
namespace pdns
29
{
30

31
bool TaskQueue::push(ResolveTask&& task)
32
{
464✔
33
  // Insertion fails if it's already there, no problem since we're already scheduled
34
  auto result = d_queue.insert(std::move(task)).second;
464✔
35
  if (result) {
464✔
36
    d_pushes++;
450✔
37
  }
450✔
38
  return result;
464✔
39
}
464✔
40

41
ResolveTask TaskQueue::pop()
42
{
28✔
43
  ResolveTask ret = d_queue.get<SequencedTag>().front();
28✔
44
  d_queue.get<SequencedTag>().pop_front();
28✔
45
  return ret;
28✔
46
}
28✔
47

48
bool ResolveTask::run(bool logErrors) const
49
{
×
50
  if (d_func == nullptr) {
×
51
    auto log = g_slog->withName("taskq")->withValues("name", Logging::Loggable(d_qname), "qtype", Logging::Loggable(QType(d_qtype).toString()));
×
52
    log->error(Logr::Debug, "null task");
×
53
    return false;
×
54
  }
×
55
  struct timeval now
×
56
  {
×
57
  };
×
58
  Utility::gettimeofday(&now);
×
59
  if (d_deadline >= now.tv_sec) {
×
60
    d_func(now, logErrors, *this);
×
61
  }
×
62
  else {
×
63
    // Deadline passed
64
    auto log = g_slog->withName("taskq")->withValues("name", Logging::Loggable(d_qname), "qtype", Logging::Loggable(QType(d_qtype).toString()));
×
65
    log->info(Logr::Debug, "deadline passed");
×
66
    return true;
×
67
  }
×
68
  return false;
×
69
}
×
70

71
} /* namespace pdns */
72

73
namespace boost
74
{
75
size_t hash_value(const ComboAddress& address)
76
{
×
77
  return ComboAddress::addressOnlyHash()(address);
×
78
}
×
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc