Timeout on Process of Join with Custom Join Server

I have implemented a custom join server that I’m using to support auto-join of my sensors to my gateway. LoRa Server forwards joins to my custom server for specialized processing and I then forward the request downstream to LoRa App Server for the remaining join processing, passing LoRa App Server response back through my custom service to LoRa Server. In this scenario, the service that I am using (a .NET Core API service) has a delay on initial request/initial service startup. That translates to a failure on first sensor join but subsequent joins succeed. Furthermore, once the service is up and running, additional joins seem to succeed without issue.

I’ve isolated where the error is occurring - the “json.NewDecoder.Decode” line in jsclient.go in LoRa Server is throwing an exception on attempts to unmarshal the response from my custom join service. Also, journalctl for loraserver shows an issue with inability to convert the response JSON to a backend.JoinAnsPayload. What I suspect is happening is that the stream being returned to and unmarshaled in LoRa Server from the custom join service gets cut off due to a timeout, resulting in an invalid JSON string for that initial request. I’ve tried increasing RxDelay to 15 (the max) but that did not help - either that is not related or 15 seconds is not enough.

Is there a different spot in the configuration where I can extend “timeout” for the join request processing so that the first request has time to complete successfully? I’ve also tried “priming” my custom service with some “dummy” requests prior to processing the first real join request but that only seems to address the internal startup time for the custom service. Is there a way to trigger a “dummy” join at the front-end starting at the LoRa Server level instead?

Thanks!

After some additional digging, I have discovered that I am actually receiving two join requests in immediate succession for the same device on first attempt to join a sensor to my gateway. After some experimentation, I have been able to inject some delay into my custom join server processing to give each time to complete successfully (the delay is only injected if another join request is received in succession for the same device). However, the join still fails to complete even though I’m getting back a successful join answer for both join requests. The device shows activated but will not start processing data.

Curious if anyone else has experienced a similar situation with multiple join requests coming in succession and, if so, how you resolved?