Skip to content

Commit 37e0a60

Browse files
authored
Merge pull request #6832 from ipfs/chore/update-deps
chore(dep): update deps
2 parents 8e0f92b + 906f45e commit 37e0a60

File tree

26 files changed

+157
-145
lines changed

26 files changed

+157
-145
lines changed

cmd/ipfs/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
227227
// check transport encryption flag.
228228
unencrypted, _ := req.Options[unencryptTransportKwd].(bool)
229229
if unencrypted {
230-
log.Warningf(`Running with --%s: All connections are UNENCRYPTED.
230+
log.Warnf(`Running with --%s: All connections are UNENCRYPTED.
231231
You will not be able to connect to regular encrypted networks.`, unencryptTransportKwd)
232232
}
233233

cmd/ipfs/daemon_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
package main
44

55
import (
6-
daemon "github.com/coreos/go-systemd/daemon"
6+
daemon "github.com/coreos/go-systemd/v22/daemon"
77
)
88

99
func notifyReady() {

core/bootstrap/bootstrap.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/libp2p/go-libp2p-core/peer"
1919
"github.com/libp2p/go-libp2p-core/peerstore"
2020
"github.com/libp2p/go-libp2p-core/routing"
21-
"github.com/libp2p/go-libp2p-loggables"
2221
)
2322

2423
var log = logging.Logger("bootstrap")
@@ -80,16 +79,14 @@ func Bootstrap(id peer.ID, host host.Host, rt routing.Routing, cfg BootstrapConf
8079
if len(cfg.BootstrapPeers()) == 0 {
8180
// We *need* to bootstrap but we have no bootstrap peers
8281
// configured *at all*, inform the user.
83-
log.Warning("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
82+
log.Warn("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
8483
}
8584

8685
// the periodic bootstrap function -- the connection supervisor
8786
periodic := func(worker goprocess.Process) {
8887
ctx := goprocessctx.OnClosingContext(worker)
89-
defer log.EventBegin(ctx, "periodicBootstrap", id).Done()
9088

9189
if err := bootstrapRound(ctx, host, cfg); err != nil {
92-
log.Event(ctx, "bootstrapError", id, loggables.Error(err))
9390
log.Debugf("%s bootstrap error: %s", id, err)
9491
}
9592

@@ -126,7 +123,6 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
126123
// determine how many bootstrap connections to open
127124
connected := host.Network().Peers()
128125
if len(connected) >= cfg.MinPeerThreshold {
129-
log.Event(ctx, "bootstrapSkip", id)
130126
log.Debugf("%s core bootstrap skipped -- connected to %d (> %d) nodes",
131127
id, len(connected), cfg.MinPeerThreshold)
132128
return nil
@@ -150,7 +146,6 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
150146
// connect to a random susbset of bootstrap candidates
151147
randSubset := randomSubsetOfPeers(notConnected, numToDial)
152148

153-
defer log.EventBegin(ctx, "bootstrapStart", id).Done()
154149
log.Debugf("%s bootstrapping to %d nodes: %s", id, numToDial, randSubset)
155150
return bootstrapConnect(ctx, host, randSubset)
156151
}
@@ -172,17 +167,14 @@ func bootstrapConnect(ctx context.Context, ph host.Host, peers []peer.AddrInfo)
172167
wg.Add(1)
173168
go func(p peer.AddrInfo) {
174169
defer wg.Done()
175-
defer log.EventBegin(ctx, "bootstrapDial", ph.ID(), p.ID).Done()
176170
log.Debugf("%s bootstrapping to %s", ph.ID(), p.ID)
177171

178172
ph.Peerstore().AddAddrs(p.ID, p.Addrs, peerstore.PermanentAddrTTL)
179173
if err := ph.Connect(ctx, p); err != nil {
180-
log.Event(ctx, "bootstrapDialFailed", p.ID)
181174
log.Debugf("failed to bootstrap with %v: %s", p.ID, err)
182175
errs <- err
183176
return
184177
}
185-
log.Event(ctx, "bootstrapDialSuccess", p.ID)
186178
log.Infof("bootstrapped with %v", p.ID)
187179
}(p)
188180
}

core/commands/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ You can now check what blocks have been created by:
286286
go func() {
287287
size, err := req.Files.Size()
288288
if err != nil {
289-
log.Warningf("error getting files size: %s", err)
289+
log.Warnf("error getting files size: %s", err)
290290
// see comment above
291291
return
292292
}

core/commands/cat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var CatCmd = &cmds.Command{
104104
return err
105105
}
106106
default:
107-
log.Warningf("cat postrun: received unexpected type %T", val)
107+
log.Warnf("cat postrun: received unexpected type %T", val)
108108
}
109109
}
110110
},

core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (n *IpfsNode) Bootstrap(cfg bootstrap.BootstrapConfig) error {
143143
cfg.BootstrapPeers = func() []peer.AddrInfo {
144144
ps, err := n.loadBootstrapPeers()
145145
if err != nil {
146-
log.Warning("failed to parse bootstrap peers from config")
146+
log.Warn("failed to parse bootstrap peers from config")
147147
return nil
148148
}
149149
return ps

core/corehttp/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var defaultLocalhostOrigins = []string{
4747
func addCORSFromEnv(c *cmdsHttp.ServerConfig) {
4848
origin := os.Getenv(originEnvKey)
4949
if origin != "" {
50-
log.Warning(originEnvKeyDeprecate)
50+
log.Warn(originEnvKeyDeprecate)
5151
c.AppendAllowedOrigins(origin)
5252
}
5353
}

core/corehttp/gateway_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func webError(w http.ResponseWriter, message string, err error, defaultCode int)
610610
func webErrorWithCode(w http.ResponseWriter, message string, err error, code int) {
611611
http.Error(w, fmt.Sprintf("%s: %s", message, err), code)
612612
if code >= 500 {
613-
log.Warningf("server error: %s: %s", err)
613+
log.Warnf("server error: %s: %s", err)
614614
}
615615
}
616616

core/corehttp/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func LogOption() ServeOption {
5050
w.WriteHeader(200)
5151
wnf, errs := newWriteErrNotifier(w)
5252
lwriter.WriterGroup.AddWriter(wnf)
53-
log.Event(n.Context(), "log API client connected")
53+
log.Event(n.Context(), "log API client connected") //nolint deprecated
5454
<-errs
5555
})
5656
return mux, nil

core/corerepo/gc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,11 @@ func (gc *GC) maybeGC(ctx context.Context, offset uint64) error {
212212

213213
if storage+offset > gc.StorageGC {
214214
if storage+offset > gc.StorageMax {
215-
log.Warningf("pre-GC: %s", ErrMaxStorageExceeded)
215+
log.Warnf("pre-GC: %s", ErrMaxStorageExceeded)
216216
}
217217

218218
// Do GC here
219219
log.Info("Watermark exceeded. Starting repo GC...")
220-
defer log.EventBegin(ctx, "repoGC").Done()
221220

222221
if err := GarbageCollect(gc.Node, ctx); err != nil {
223222
return err

core/node/libp2p/discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (dh *discoveryHandler) HandlePeerFound(p peer.AddrInfo) {
2424
ctx, cancel := context.WithTimeout(dh.ctx, discoveryConnTimeout)
2525
defer cancel()
2626
if err := dh.host.Connect(ctx, p); err != nil {
27-
log.Warningf("failed to connect to peer %s found by discovery: %s", p.ID, err)
27+
log.Warnf("failed to connect to peer %s found by discovery: %s", p.ID, err)
2828
}
2929
}
3030

core/node/libp2p/pnet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ func PNetChecker(repo repo.Repo, ph host.Host, lc fx.Lifecycle) error {
5151
select {
5252
case <-t.C:
5353
if len(ph.Network().Peers()) == 0 {
54-
log.Warning("We are in private network and have no peers.")
55-
log.Warning("This might be configuration mistake.")
54+
log.Warn("We are in private network and have no peers.")
55+
log.Warn("This might be configuration mistake.")
5656
}
5757
case <-done:
5858
return

core/node/libp2p/smux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func makeSmuxTransportOption(mplexExp bool) libp2p.Option {
3636
for _, id := range order {
3737
tpt, ok := muxers[id]
3838
if !ok {
39-
log.Warning("unknown or duplicate muxer in LIBP2P_MUX_PREFS: %s", id)
39+
log.Warn("unknown or duplicate muxer in LIBP2P_MUX_PREFS: %s", id)
4040
continue
4141
}
4242
delete(muxers, id)

core/node/libp2p/transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func Security(enabled, preferTLS bool) interface{} {
1515
if !enabled {
1616
return func() (opts Libp2pOpts) {
1717
// TODO: shouldn't this be Errorf to guarantee visibility?
18-
log.Warningf(`Your IPFS node has been configured to run WITHOUT ENCRYPTED CONNECTIONS.
18+
log.Warnf(`Your IPFS node has been configured to run WITHOUT ENCRYPTED CONNECTIONS.
1919
You will not be able to connect to any nodes configured to use encrypted connections`)
2020
opts.Opts = append(opts.Opts, libp2p.NoSecurity)
2121
return opts

fuse/ipns/ipns_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (s *Root) Lookup(ctx context.Context, name string) (fs.Node, error) {
201201
ipnsName := "/ipns/" + name
202202
resolved, err := s.Ipfs.Namesys.Resolve(s.Ipfs.Context(), ipnsName)
203203
if err != nil {
204-
log.Warningf("ipns: namesys resolve error: %s", err)
204+
log.Warnf("ipns: namesys resolve error: %s", err)
205205
return nil, fuse.ENOENT
206206
}
207207

fuse/mount/fuse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ func (m *mount) unmount() error {
110110
m.setActive(false)
111111
return nil
112112
}
113-
log.Warningf("fuse unmount err: %s", err)
113+
log.Warnf("fuse unmount err: %s", err)
114114

115115
// try closing the fuseConn
116116
err = m.fuseConn.Close()
117117
if err == nil {
118118
m.setActive(false)
119119
return nil
120120
}
121-
log.Warningf("fuse conn error: %s", err)
121+
log.Warnf("fuse conn error: %s", err)
122122

123123
// try mount.ForceUnmountManyTimes
124124
if err := ForceUnmountManyTimes(m, 10); err != nil {

fuse/mount/mount.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Mount interface {
3636
// It does so by calling diskutil or fusermount directly.
3737
func ForceUnmount(m Mount) error {
3838
point := m.MountPoint()
39-
log.Warningf("Force-Unmounting %s...", point)
39+
log.Warnf("Force-Unmounting %s...", point)
4040

4141
cmd, err := UnmountCmd(point)
4242
if err != nil {
@@ -98,7 +98,7 @@ type closer struct {
9898
}
9999

100100
func (c *closer) Close() error {
101-
log.Warning(" (c *closer) Close(),", c.M.MountPoint())
101+
log.Warn(" (c *closer) Close(),", c.M.MountPoint())
102102
return c.M.Unmount()
103103
}
104104

fuse/readonly/readonly_unix.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
fs "bazil.org/fuse/fs"
2121
ipld "github.com/ipfs/go-ipld-format"
2222
logging "github.com/ipfs/go-log"
23-
lgbl "github.com/libp2p/go-libp2p-loggables"
2423
)
2524

2625
var log = logging.Logger("fuse/ipfs")
@@ -186,7 +185,7 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
186185
}
187186
nd, err := s.Ipfs.DAG.Get(ctx, lnk.Cid)
188187
if err != nil {
189-
log.Warning("error fetching directory child node: ", err)
188+
log.Warn("error fetching directory child node: ", err)
190189
}
191190

192191
t := fuse.DT_Unknown
@@ -195,7 +194,7 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
195194
t = fuse.DT_File
196195
case *mdag.ProtoNode:
197196
if fsn, err := ft.FSNodeFromBytes(nd.Data()); err != nil {
198-
log.Warning("failed to unmarshal protonode data field:", err)
197+
log.Warn("failed to unmarshal protonode data field:", err)
199198
} else {
200199
switch fsn.Type() {
201200
case ft.TDirectory, ft.THAMTShard:
@@ -238,22 +237,11 @@ func (s *Node) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string,
238237
}
239238

240239
func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
241-
c := s.Nd.Cid()
242-
243-
// setup our logging event
244-
lm := make(lgbl.DeferredMap)
245-
lm["fs"] = "ipfs"
246-
lm["key"] = func() interface{} { return c.String() }
247-
lm["req_offset"] = req.Offset
248-
lm["req_size"] = req.Size
249-
defer log.EventBegin(ctx, "fuseRead", lm).Done()
250-
251240
r, err := uio.NewDagReader(ctx, s.Nd, s.Ipfs.DAG)
252241
if err != nil {
253242
return err
254243
}
255-
o, err := r.Seek(req.Offset, io.SeekStart)
256-
lm["res_offset"] = o
244+
_, err = r.Seek(req.Offset, io.SeekStart)
257245
if err != nil {
258246
return err
259247
}
@@ -266,7 +254,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
266254
default:
267255
return err
268256
}
269-
lm["res_size"] = n
257+
resp.Data = resp.Data[:n]
270258
return nil // may be non-nil / not succeeded
271259
}
272260

gc/gc.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ type Result struct {
4040
func GC(ctx context.Context, bs bstore.GCBlockstore, dstor dstore.Datastore, pn pin.Pinner, bestEffortRoots []cid.Cid) <-chan Result {
4141
ctx, cancel := context.WithCancel(ctx)
4242

43-
elock := log.EventBegin(ctx, "GC.lockWait")
4443
unlocker := bs.GCLock()
45-
elock.Done()
46-
elock = log.EventBegin(ctx, "GC.locked")
47-
emark := log.EventBegin(ctx, "GC.mark")
4844

4945
bsrv := bserv.New(bs, offline.Exchange(bs))
5046
ds := dag.NewDAGService(bsrv)
@@ -55,7 +51,6 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, dstor dstore.Datastore, pn
5551
defer cancel()
5652
defer close(output)
5753
defer unlocker.Unlock()
58-
defer elock.Done()
5954

6055
gcs, err := ColoredSet(ctx, pn, ds, bestEffortRoots, output)
6156
if err != nil {
@@ -65,12 +60,6 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, dstor dstore.Datastore, pn
6560
}
6661
return
6762
}
68-
emark.Append(logging.LoggableMap{
69-
"blackSetSize": fmt.Sprintf("%d", gcs.Len()),
70-
})
71-
emark.Done()
72-
esweep := log.EventBegin(ctx, "GC.sweep")
73-
7463
keychan, err := bs.AllKeysChan(ctx)
7564
if err != nil {
7665
select {
@@ -113,10 +102,6 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, dstor dstore.Datastore, pn
113102
break loop
114103
}
115104
}
116-
esweep.Append(logging.LoggableMap{
117-
"whiteSetSize": fmt.Sprintf("%d", removed),
118-
})
119-
esweep.Done()
120105
if errors {
121106
select {
122107
case output <- Result{Error: ErrCannotDeleteSomeBlocks}:
@@ -125,7 +110,6 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, dstor dstore.Datastore, pn
125110
}
126111
}
127112

128-
defer log.EventBegin(ctx, "GC.datastore").Done()
129113
gds, ok := dstor.(dstore.GCDatastore)
130114
if !ok {
131115
return

0 commit comments

Comments
 (0)