Light-4j server stops responding to HTTP GET or POST - light-4j

I am facing some issue with 1.6.5 version.
Sometimes the server stops replying to my http rest calls. The tcpdump indicated proper tcp hand-shake..and http request going. But no response comes from server.
This is basic http get call and no processing on the server is happening. Server should receive this call and should reply back with 200 OK response.
If I restart the server, it starts working again. This issue is intermittent.
Any pointers would be really appreciated

Thanks for posting the question on this site. It is easier to search than in other places.
When the server stops responding to the exact same request after a while, it is very possible that there are some memory leak or connection leak in the business logic. You can put some debug info on the suspected code block or run the application in debug mode in an IDE. Light-4j application is just a plain Java SE application and you can debug it in the IDE to pinpoint the issue easily.

Thanks for the reply. I my case, the issue might have been synchronized section of business logic. One of the REST call was in the critical section and did not return which resulted in blocking of the new REST calls. I am still watching this issue.
Vikram

Related

Spring boot backend produces a HTTP 200 response but front end doesn't receive it

I have an spring boot application that is deployed on a tomcat 8 webserver running on a CentOS machine that uses a MSSQL 13.0.5026.0 db on a windows server 2016.
I have a simple REST controller that produces a response to a request.
I can see from logs that backend produces a 200 response after finishing the request task.
The problem is that frontend never receives the response. It remains in pending.
It's a problem I have been experiencing in production only recently on a codebase that didn't change lately.
The same app worked normally until lately so I dont't believe it's an issue with spring it self but rather with tomcat, catalina, network, DB or other actors that could contribute to the problem
I checked the DB for eventual deadlocks or pending transactions that didn't finish appropriatelly and I found no issues.
I tried restarting the tomcat service and the DB service but unfortunatelly the problem continued to persist.
The response produced is a simple string message so I don't believe that a network problem due to response size is an issue.
Do you have any experience with similar problems? What could produce such a result?
Thank you

Making request using WebSockets in sails but not receiving response from the server

I'm starting with Websockets and I have a problem.
I have a sails.js application that uses sockets to update the client side.
On the client side it makes an API call using socket.get("/api/v1/actor...") to bring all the items of the database. When I see what the WebSocket's traffic on the Chrome console:
As you can see, the connection has been established and the API call has been correctly done through the socket.
The problem is, there is no answer from the server, not even an error.
If I make the same API call using ajax, I get response, but it doesn't work using WebSockets.
Any idea what might be producing this behavior?
EDIT: I add here the code here that processes the request and this one here that sends the request, but the problem is that it never execute this code. I think we we are closer to the find the cause, since we think it has to do with a network problem. We figured there is an F5 reverse-proxy which is not properly set up to handle websockets
The answer didn't make any sense now that I've seen the code that's why I've edited it. I only answered because I could't comment on your question and ask you for the code.
Your calling code seems correct and the server side of things the process of response should be handled automatically by the framework, you only need to return some JSON in the controller method.
I instantiated a copy of the server (just changed the adapters to run it locally) and the server replied to the web socket requests (although I only tested the route '/index').
Normally when the problems are caused by a reverse proxy the socket simply refuses to connect and you can't even send data to server. Does the property "socket.socket.connected" returns true?
The best way to test is to write a small node application with socket.io client and test it in the same machine that the application server is running, then you can exclude network problems.

Are there any reasons why Heroku might silently reject requests with status code 400?

I'm trying to diagnose an issue whereby an embedded device running an HTTP client to issue requests to a Node.js Web application running on Heroku is receiving empty responses with status code 400.
The problem I'm facing is that the presumably failing requests do not even appear in the Heroku logs, so it's certainly not the Web application code returning those 400s.
On the other hand issuing requests to the Web application from a browser works just fine and the requests do appear in the Heroku logs.
I'm trying to figure out whether the embedded client is really sending requests at all and I'm wondering if there are any reasons why Heroku might send back those 400s without the requests even appearing in the logs.
The cause was related to a badly implemented HTTP client in the device that was issuing requests omitting the host header.
Adding the header solved the problem.

gevent-socketio - Error during WebSocket handshake: Unexpected response code: 401

I am working on a pyramid realtime app that would benefit from utilizing websockets. I found that the gevent-socketio library would probably be best for my purposes.
When testing locally on my PC, the websocket transport is used and runs just fine. However, when testing on a server, the handshake fails reporting a 401 response. It then falls back to a long polling transport, which works, but I would really benefit from the speed of websocket.
This makes me believe that there is some kind of authorization issue happening since I am not connecting to the local machine anymore, but I am at a complete loss as to where to look for help.
EDIT:
Now the issue was narrowed down to the fact that we were using mod_proxy, a lighttpd module, to instance the server for development and production. Is there any work around for proxying or do we have to a abandon the idea of server instancing? Ideally we would like to have some way of authorizing users to access our development server, which is how we had it set up with mod_proxy.

What raises HTTP 503 and how to change timeout?

I have inherited an application (internal to my company) that uses javascript running in Internet Explorer which makes Ajax calls to a Struts-based application running in WebLogic Server v10.
Certain server-side operations in the system are taking longer than 3 minutes. Users consistently noticed that the Ajax call returns 503 error at the 3 minute mark. My users can wait longer than 3 minutes, but 503 errors interrupt their work.
This application needs to be performance tuned, but we badly need a temporary workaround to extend how much time can occur before a 503 error is returned.
The current theory is that the 503 error is being raised by the IE XMLHttpRequest object. A team of supposed WebLogic experts poured over our code and WebLogic logs, and declared that there's no timeout occurring on the server side. But I have my doubts.
My question is, which piece of software is responsible for raising 503 error: the browser, the Ajax javascript, or the server? And can this timeout period be changed?
A 503 error is kind of a catch-all for a lot of different types of errors, usually on the server side. In your case it could be that the server is just rejecting the connection after a certain timeout, and responding back with a 503 to indicate that the server is overloaded or cannot process your request.
A lot of times with web services, a 503 will be returned when the server code throws an exception or error. If the server code doesn't properly handle the error, it will bubble up to the server, which will just respond back with a generic 503.
http://www.checkupdown.com/status/E503.html
Error code 5xx (alternate definition)
RFC 2616
503 is a server error. XMLHttpRequest will happily wait longer than 3 minutes. The first thing you should do is satisfy yourself of that by visiting the problem URL in telnet or netcat or similar and seeing the 503 with javascript out of the picture.
Then you can proceed to find the timeout on the server side.
Your web server has a request reply timeout which is being tripped by long-running service requests. It could be the WebLogic server or a proxy. It is certainly not the client.
Have you considered submitting an asynchronous HTTP request that will be responded to immediately, and then polling another location for the eventual results? Three minutes is about 170 seconds too long.
503 is most likely due to a timeout on the server. If you can tune your Apache server, read about the Timeout attribute that you can set in httpd.conf.
Look in the httpd/logs/error_log to see if timeouts are occurring.
Refer also to this answer: Mod cluster proxy timeout in apache error logs .

Resources