Skip to content
Snippets Groups Projects
Unverified Commit 8f5d0e6d authored by Hans Moog's avatar Hans Moog Committed by GitHub
Browse files

Merge branch 'develop' into develop.mergeBinary

parents 2c5e031a 5ba8b574
No related branches found
No related tags found
No related merge requests found
...@@ -27,11 +27,10 @@ VOLUME /app/mainnetdb ...@@ -27,11 +27,10 @@ VOLUME /app/mainnetdb
EXPOSE 14666/tcp EXPOSE 14666/tcp
EXPOSE 14626/udp EXPOSE 14626/udp
EXPOSE 14626/tcp
# Copy the Pre-built binary file from the previous stage # Copy the Pre-built binary file from the previous stage
COPY --from=build /go/bin/goshimmer . COPY --from=build /go/bin/goshimmer .
# Copy the docker config # Copy the docker config
COPY docker.config.json config.json COPY config.json config.json
ENTRYPOINT ["./goshimmer"] ENTRYPOINT ["./goshimmer"]
{
"analysis": {
"serveraddress": "ressims.iota.cafe:188",
"serverport": 0
},
"autopeering": {
"address": "0.0.0.0",
"entrynodes": [
"V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626"
],
"port": 14626
},
"database": {
"directory": "mainnetdb"
},
"gossip": {
"port": 14666
},
"logger": {
"Level": "info",
"DisableCaller": true,
"DisableStacktrace": false,
"Encoding": "console",
"OutputPaths": [
"stdout",
"goshimmer.log"
],
"DisableEvents": true
},
"node": {
"disablePlugins": [],
"enablePlugins": []
}
}
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
) )
func main() { func main() {
go http.ListenAndServe("localhost:6060", nil) // pprof Server for Debbuging Mutexes go http.ListenAndServe("localhost:6061", nil) // pprof Server for Debbuging Mutexes
testTxId := transaction.NewId([]byte("Test")) testTxId := transaction.NewId([]byte("Test"))
......
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"github.com/iotaledger/goshimmer/packages/netutil/buffconn" "github.com/iotaledger/goshimmer/packages/netutil/buffconn"
"github.com/iotaledger/hive.go/autopeering/peer" "github.com/iotaledger/hive.go/autopeering/peer"
"github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/logger"
"go.uber.org/atomic"
) )
var ( var (
...@@ -19,16 +20,18 @@ var ( ...@@ -19,16 +20,18 @@ var (
) )
const ( const (
neighborQueueSize = 5000 neighborQueueSize = 5000
maxNumReadErrors = 10 maxNumReadErrors = 10
droppedMessagesThreshold = 1000
) )
type Neighbor struct { type Neighbor struct {
*peer.Peer *peer.Peer
*buffconn.BufferedConnection *buffconn.BufferedConnection
log *logger.Logger log *logger.Logger
queue chan []byte queue chan []byte
messagesDropped atomic.Int32
wg sync.WaitGroup wg sync.WaitGroup
closing chan struct{} closing chan struct{}
...@@ -150,6 +153,10 @@ func (n *Neighbor) Write(b []byte) (int, error) { ...@@ -150,6 +153,10 @@ func (n *Neighbor) Write(b []byte) (int, error) {
case <-n.closing: case <-n.closing:
return 0, nil return 0, nil
default: default:
return 0, ErrNeighborQueueFull if n.messagesDropped.Inc() >= droppedMessagesThreshold {
n.messagesDropped.Store(0)
return 0, ErrNeighborQueueFull
}
return 0, nil
} }
} }
...@@ -87,8 +87,8 @@ func TestNeighborParallelWrite(t *testing.T) { ...@@ -87,8 +87,8 @@ func TestNeighborParallelWrite(t *testing.T) {
go func() { go func() {
defer wg.Done() defer wg.Done()
for i := 0; i < neighborQueueSize; i++ { for i := 0; i < neighborQueueSize; i++ {
_, err := neighborA.Write(testData) l, err := neighborA.Write(testData)
if err == ErrNeighborQueueFull { if err == ErrNeighborQueueFull || l == 0 {
continue continue
} }
assert.NoError(t, err) assert.NoError(t, err)
...@@ -99,8 +99,8 @@ func TestNeighborParallelWrite(t *testing.T) { ...@@ -99,8 +99,8 @@ func TestNeighborParallelWrite(t *testing.T) {
go func() { go func() {
defer wg.Done() defer wg.Done()
for i := 0; i < neighborQueueSize; i++ { for i := 0; i < neighborQueueSize; i++ {
_, err := neighborA.Write(testData) l, err := neighborA.Write(testData)
if err == ErrNeighborQueueFull { if err == ErrNeighborQueueFull || l == 0 {
continue continue
} }
assert.NoError(t, err) assert.NoError(t, err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment