californium-proxy: Move doReceiveMessage(coapRequest) to its own Thread.
This patch aims at addressing a bug in HttpStack:
doReceiveMessage(coapRequest) may be blocked waiting for a response
infinitely. If too much requests leading to to such behaviour are
received, all HTTP Stack I/O Threads with be stuck waiting for content
leading to refused requests.
This patch move the blocking call to doReceiveMessage(coapRequest) from
the HTTP I/O threads to a dedicaced thread. This one is launched in
http request handler (I/O thread), implementing the missing "producer"
thread of the producer/consummer patern. If no response is received at
time (GATEWAY_TIMEOUT), the two threads will be killed (one immediately,
one after issuing a default http response).
Maybe this patch will requires additional work for a better / proper
integration within the HTTP Stack. Meanwhile, it provide a working
solution for a know bug [1]. We are already using it in production.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
californium-proxy: Move doReceiveMessage(coapRequest) to its own Thread.
This patch aims at addressing a bug in HttpStack: doReceiveMessage(coapRequest) may be blocked waiting for a response infinitely. If too much requests leading to to such behaviour are received, all HTTP Stack I/O Threads with be stuck waiting for content leading to refused requests.
This patch move the blocking call to doReceiveMessage(coapRequest) from the HTTP I/O threads to a dedicaced thread. This one is launched in http request handler (I/O thread), implementing the missing "producer" thread of the producer/consummer patern. If no response is received at time (GATEWAY_TIMEOUT), the two threads will be killed (one immediately, one after issuing a default http response).
Maybe this patch will requires additional work for a better / proper integration within the HTTP Stack. Meanwhile, it provide a working solution for a know bug [1]. We are already using it in production.
[1] https://dev.eclipse.org/mhonarc/lists/cf-dev/msg00145.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBAgAGBQJWDA+LAAoJELFU+P/mVOqne34P/jzjxJXHMoiZLG9jo1l+EjVl wTZz8MhRXxEKST1d/VXckzurB3fZ7ipCAaNEJvxiWCiNZlVTND0/74FqwV8BDiKP NT1930s0c/1jiXEYxtXDFmZjAYl4J/R5ydqKHoPFauRCxK05idgiOiyLeP1ET0r7 veOYp+kmFvXlmNr6qrchRno3wJAKdxy6/r0gZySYDvd0gCuxIJUEQxBoSud/BZ5S eTjckqYQQRghvhKWccCnF2uS5woo85EmdphSjgcLYREfYN9f6cYImdlkWRDPGlBv HguE3eQwUsmwNHHn9JnY69bHS7Gd8voZ6vksUcunS+BmYp1RFir9UYQqaOt6zSpZ 5PBV3HnQTigVrrQYctvtL8DcPIWTp6f1IxT8aNzlQT0hnIOBA8O81Vq66m6yh3CJ IcWwunw+9Pvfi4OsvWIT2IKLkU3pF9Z2QWNQW+G2f1iXOGSU0sKSFyiBu+05MzIZ dnyxrjPEeezsw5RVe+sgCydLUc06PDK+zDG2Ur8z+bcyHxxbIQKBZaLgnCclHYNK /FIWQl5Ug9sidkIOtvPS9hE2V1NSDtfezHXPE4Tm6iktvWYAJ2Mj+WplJ7BhSq5t xCBgTDeXtQ6ar6euVn0F4g6f70BH4d1ITumMS7EWuUdv5TT5HZU6/yea5cuym4j4 kV8w5BrTug8DkPcC0tXx =jnBm -----END PGP SIGNATURE-----