IOS WebDriverAgent Proxying POST issue from second test runs in Appium 1.6.3

Hi,

I am new to appium. I am performing ios webautomation, where i start appium(1.6.3) command from my java code (using process and processbuilder). Appium started sucessfully with its node config capabilities and configurations, which also got registered with the selenium hub.

MyIPhone.json:

{“capabilities”:
[
{
“automationName”:“XCUITest”,
“useNewWDA”:true,
“browserName”:“safari”,
“maxInstances”:1,
“platformName”:“iOS”,
“deviceName”:“iPhoneSE”,
“version”:“10.0.1”,
“deviceID”:“udid”,
“wdaLocalPort”:8101
}
],
“configuration”:{“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“cleanUpCycle”:2000,
“port”:5556,
“host”:“123.45.67.89”,
“maxSession”:6,
“hubHost”:“123.455.67.89”,
“registerCycle”:5000,
“hubPort”:“8080”,
“timeout”:30000,
“url”:“http://123.455.67.89:8080/wd/hub”,
“register”:true
}
}

MyTestScript Capabilities(references):

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“browserName”, “safari”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“deviceName”, “iPhoneSE”);
capabilities.setCapability(“version”, “10.0.1”);
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“wdaLocalPort”, “8101”);
capabilities.setCapability(“useNewWDA”, true);

The test run got successfully executed for the first time. The problem is, when i execute for the second time and further runs, it hangs and no indication of launching the browser,

Appium logs(for the second time script execution):
[debug] [XCUITest] WebDriverAgent successfully started after 21834ms
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8101/session] with body: {“desiredCapabilities”:{“bundleId”:“com.apple.mobilesafari”,“arguments”:["-u",“http://appium.io”],“shouldWaitForQuiescence”:true}}
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -

After few seconds i got an info in the Hub like,
INFO - Removed a session that had not yet assigned an external key 7e1e7755-0f55-4180-b49a-4a54ad4c366c, indicates failure in session creation PROXY_REREGISTRATION

So, i cant run any of my scripts untill i restart my iphone device. After restart it will again run successfully for the first time and hangs from my next runs.

Even i checked for any iProxy process is open for the wdalocalport, but it is not available.

Listing below the environments i am using,
macOS Sierra 10.12.1
xcode 8.2.1
Appium 1.6.3
Nodejs 7.2.0
Real Device iPhoneSE-iOS version 10.0.1
libimobiledevice --HEAD
selenium-server-standalone-3.0.1.jar(for hub)

Can someone help me to resolve this.

Thank you