Skip to content

Commit 672f0b9

Browse files
committed
Function worker: debug messages for sending remote messages
1 parent 7ea1d4f commit 672f0b9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

FunctionWorker/python/PublicationUtils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,20 +318,22 @@ def _send_remote_message(self, remote_address, message_type, action_data):
318318
# retry 7 times, wait for 5 seconds for the connection to time out
319319
while retry <= 6.4:
320320
try:
321+
action_data_str = json.dumps(action_data)
322+
self._logger.debug("Sending remote message (" + message_type + ") : " + action_data_str)
321323
resp = requests.post(remote_address,
322324
params={"async": 1},
323325
json={},
324326
timeout=5,
325327
headers={"x-mfn-action": message_type,
326-
"x-mfn-action-data": json.dumps(action_data)})
328+
"x-mfn-action-data": action_data_str})
327329
break
328330
except Exception as exc:
329331
self._logger.debug("Sending remote message (" + message_type + ") failed: " + str(exc) + "; retrying in: " + str(retry) + "s")
330332
time.sleep(retry)
331333
retry = retry * 2
332334

333335
if retry > 6.4:
334-
self._logger.info("Could not send remote message (" + message_type + ") due to timeouts.")
336+
self._logger.debug("Could not send remote message (" + message_type + ") due to timeouts.")
335337

336338

337339
def _publish_privileged_output(self, function_output, lqcpub):

Sandbox/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ clean:
2626
make -C frontend clean
2727
make -C ../redis clean
2828
rm -rf build/*
29+
rm sandbox_deployment_package.tar.gz
2930

3031
build_thrift:
3132
cd ../build_tools/thrift/$(THRIFT_VERSION)/; ./build_thrift.sh; cd -
@@ -42,10 +43,7 @@ build/SandboxAgent.tar.gz: $(SBASOURCE) $(FWSOURCE)
4243
mkdir -p build
4344
tar -czf $@ ../SandboxAgent
4445

45-
build/FunctionWorker.tar.gz: \
46-
$(FWSOURCE) \
47-
../build_env.mk \
48-
../build_tools/thrift/$(THRIFT_VERSION)/build_thrift.sh
46+
build/FunctionWorker.tar.gz: $(FWSOURCE) ../build_env.mk ../build_tools/thrift/$(THRIFT_VERSION)/build_thrift.sh
4947
cd ../build_tools/thrift/$(THRIFT_VERSION)/; ./build_thrift.sh; cd -
5048
mkdir -p build
5149
docker run --user $$(id -u):$$(id -g) --rm -v $$(pwd)/../:/root -w /root $(THRIFT_IMAGE_NAME):$(THRIFT_VERSION) bash -c '\

0 commit comments

Comments
 (0)