Skip to content

Commit f4c96c0

Browse files
committed
fix: network+master: don't aggressively poll IPC nodes
1 parent 8a0ec0b commit f4c96c0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/components/ipc/server/server.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ proc talk(server: var IPCServer, process: var FerusProcess) {.inline.} =
349349

350350
proc receiveMessages*(server: var IPCServer) {.inline.} =
351351
for gi, group in server.groups:
352-
validate group
352+
# validate group
353353
# debug "receiveMessages(): processing group " & $group.id
354354

355355
for i, _ in group:
356356
var process = group[i]
357357
server.talk(process)
358358
server.groups[gi][i] = move(process)
359359

360-
server.commitKicks()
360+
sleep(100)
361361

362362
proc poll*(server: var IPCServer) =
363363
server.findDeadProcesses()

src/components/network/process.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import std/[base64, strutils, sequtils, importutils, logging, options, json, net]
1+
import std/[base64, strutils, sequtils, importutils, logging, options, os, json, net]
22
import pkg/sanchar/[http, proto/http/shared], pkg/sanchar/parse/url
33
import pkg/pretty
44
import pkg/whisky
@@ -98,6 +98,7 @@ proc talk(client: FerusNetworkClient, process: FerusProcess) {.inline.} =
9898
discard nix.ioctl(client.ipc.socket.getFd().cint, nix.FIONREAD, addr count)
9999

100100
if count < 1:
101+
sleep(100)
101102
return
102103

103104
let

0 commit comments

Comments
 (0)