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

lightningnetwork / lnd / 13440912774

20 Feb 2025 05:14PM UTC coverage: 57.697% (-1.1%) from 58.802%
13440912774

Pull #9535

github

guggero
GitHub: remove duplicate caching

Turns out that actions/setup-go starting with @v4 also adds caching.
With that, our cache size on disk has almost doubled, leading to the
GitHub runner running out of space in certain situation.
We fix that by disabling the automated caching since we already have our
own, custom-tailored version.
Pull Request #9535: GitHub: remove duplicate caching

103519 of 179417 relevant lines covered (57.7%)

24825.3 hits per line

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

0.0
/lncfg/pprof.go
1
package lncfg
2

3
import (
4
        "net"
5
        "strconv"
6
)
7

8
// Pprof holds the configuration options for LND's built-in pprof server.
9
//
10
//nolint:ll
11
type Pprof struct {
12
        CPUProfile string `long:"cpuprofile" description:"Write CPU profile to the specified file"`
13

14
        Profile string `long:"profile" description:"Enable HTTP profiling on either a port or host:port"`
15

16
        BlockingProfile int `long:"blockingprofile" description:"Used to enable a blocking profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every blocking event, and 0 including no events."`
17

18
        MutexProfile int `long:"mutexprofile" description:"Used to Enable a mutex profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every mutex event, and 0 including no events."`
19
}
20

21
// Validate checks the values configured for the profiler.
22
func (p *Pprof) Validate() error {
×
23
        if p.BlockingProfile > 0 {
×
24
                log.Warn("Blocking profile enabled only useful for " +
×
25
                        "debugging because of significant performance impact")
×
26
        }
×
27

28
        if p.MutexProfile > 0 {
×
29
                log.Warn("Mutex profile enabled only useful for " +
×
30
                        "debugging because of significant performance impact")
×
31
        }
×
32

33
        if p.CPUProfile != "" {
×
34
                log.Warn("CPU profile enabled only useful for " +
×
35
                        "debugging because of significant performance impact")
×
36
        }
×
37

38
        if p.Profile != "" {
×
39
                str := "%v: The profile port must be between 1024 and 65535"
×
40

×
41
                // Try to parse Profile as a host:port.
×
42
                _, hostPort, err := net.SplitHostPort(p.Profile)
×
43
                if err == nil {
×
44
                        // Determine if the port is valid.
×
45
                        profilePort, err := strconv.Atoi(hostPort)
×
46

×
47
                        if err != nil || profilePort < 1024 ||
×
48
                                profilePort > 65535 {
×
49

×
50
                                return &UsageError{Err: mkErr(str, hostPort)}
×
51
                        }
×
52
                } else {
×
53
                        // Try to parse Profile as a port.
×
54
                        profilePort, err := strconv.Atoi(p.Profile)
×
55
                        if err != nil || profilePort < 1024 ||
×
56
                                profilePort > 65535 {
×
57

×
58
                                return &UsageError{Err: mkErr(str, p.Profile)}
×
59
                        }
×
60

61
                        // Since the user just set a port, we will serve
62
                        // debugging information over localhost.
63
                        p.Profile = net.JoinHostPort("127.0.0.1", p.Profile)
×
64
                }
65
        }
66

67
        return nil
×
68
}
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

© 2025 Coveralls, Inc