I have an application that constantly sends requests to server. I use GetWebResponse() method of WebClient class for sending requests. But after a few requests, it starts throwing timeout exceptions. This happens only on Mono/Linux. The same code runs without any exceptions on .Net/Windows. Do you have any ideas what might be the problem?
Note: I tried setting Timeout and ReadWriteTimeout properties of the requests with no luck.
I would try these possible alternatives to try to solve the problem:
Upgrade Mono to 3.0.x. There have been a lot of fixes in the last months around WebRequests.
If the above doesn't help, try Mono 3.2 (as it defaults to use a new garbage collector, much faster, called SGEN).
If the above doesn't help, build your own Mono (master branch), as this important pull request has been merged recently.
If the above doesn't help, use the "--server" flag when calling your mono executable (this feature is only available in the last version of mono, which you need to compile from the master branch).
If all the above doesn't help, then CC yourself in this bug, as I think I'll have time in August to implement a fix for it, and maybe it helps you.
Related
I've created up a nodejs mono-repo project using tuborepo and the kitchen-sink template.
Here I have some applications, the code that I am going to release, and some packages, basically are shared functions and logic that the applications may or may not use.
It worked well, until some days ago, when I've found a strage behavior in some of my apps.
I have to make some changes to an application, so I've opened up Visual Studio Code, I've run yarn dev, and I was ready to code, but when I've started the application that need to update, I've noticed that it won't start, usually it takes some time, like 5 seconds at most, but this time it was taking up to 30-40 seconds util the node process exited.
I've tried with another application that is very similar but differs in some way, and I've encountered the same issue, so I've decided to create and empty test suite check if everything was still working fine, and it did, I mean the node process was not crashing and I've had the output I expected.
Then I've started to import from the packages the modules I needed, and I've noticed that a particular one causes this weird problem.
This module depends on other packages, and its main purpose is to serve up classes and functions that may be use from the application.
The problem is: when use the import ... from ... from the application code, the process hangs, then sometimes it can start properly so the code is executed, sometimes the node process exits, without an error message and with a status code of 0.
I've tried to use the process.on("uncaughtException") and process.on("unhandledException") but neither of them are ever fired, segault-handler doesn't help either since it does not report anything.
I've checked the code of this module, and it does not execute some functions or perform logic while it is importing, so I don't think it has to do with slow running functions.
I have only one theory, circular dependencies so a js file to includes another js file which itself includes the first one? but I don't think so since the code used to work just fine.
I've to use a backup of the code I have when It worked, but still, I do have the same error
I was wondering guys if you could please give me some hints to fix the bug, or if you had a similar issue explain how to solve.
I've been going through the documentation at https://bazelbuild.github.io/rules_nodejs/ in order to put together a small web based application. I've got babel building the JS code, and http_server serving it, and ibazel watching it, and everything is working as expected: when I make a change, ibazel notices it and restarts the http_server rule.
The next thing I wanted to look at is getting autoreload in the browser so that the browser would automatically refresh when the change was compiled. My understanding is that this requires the http server to not be killed by ibazel, but instead to stay up and trigger a refresh via the ibazel_live_reload mechanism. I believe that http_server doesn't support this, but ts_devserver is explicitly mentioned in several places. However, ts_devserver doesn't seem to be maintained anymore (although I did find a devserver EXE in the npm package, there isn't a bazel rule that I saw to use it).
Is there a third party live development server that supports the ibazel reload mechanism - or am I missing something completely obvious?
Disclosure, I'm a core maintainer on rules_nodejs
As of rules_nodejs v3.0.0, ts_devserver has been renamed to concatjs_devserver to try and better namespace it (it has little to nothing really to do with Typescript). Its docs can be found here.
Note though that the concatjs_devserver comes with some compatibility gotchas, all dependencies have to be in named AMD/UMD or goog.module format for example, and may be tricky to use unless following the rest of the google3 toolchain.
We've (as the maintainers of rules_nodejs) tried not to wrap an existing devserver and publish it as of yet for various reasons, but it's something that has come up in discussion. I'm currently investigating some options in this space.
I'm not aware of any published devservers that currently support the ibazel protocol, there is a wrap of browsersync in the Angular Components repo which you may find useful.
I have a Koa application that has a multipart/form-data file upload that has suddenly stopped working. I have spent over 8 hours now trying to isolate the issue. What I've tried/verified:
Not a Node 6 issue; same problem occurs with Node 4 (which was previously working).
Have ruled out version issues in packages.json; have tested against originally working versions of all relevant packages, and latest versions.
Issue exhibits in latest Chrome and latest Firefox.
Issue does NOT exhibit when POSTing directly from Postman with exact same headers as browser is sending (excepting Cookie and Referer, neither of which can be set in Postman).
Problem exhibits with Koa wrappers koa-better-body and koa-multer.
Problem exhibits when directly using busboy, formidable, and even multiparty.
Similar to problems people were reporitng on this multer issue; tried all suggestions (including the long shot of adding field parameters before file parameter) to no avail.
Have tried to recreate minimal test case to reproduce, but have been unable to.
Have tried whittling down my app line by line, examining Babel output against minimal test case until they are functionally identical, problem still persists in my app, but not in test case.
All tests running on the same server, with the same browsers.
When debugging, the cleanest view of the problem is with formidable, in incoming_form.js. A single data event occurs:
Then an abort event:
After that, the browser eventually times out. (The file is larger than the 15 bytes being received in the first data event.)
I had hoped for a quick fix by switching from formidabl to busboy, and now I am a real bind, because this problem needs to get fixed, and I am running out of ways to look at the problem. I've tried to slice it every way I can think of, debug it every way I can think of, and short of writing my own multipart parser (not a task I would relish), I'm fast running out of options.
Has anyone run across this? Do you have any ideas how I might proceed with debugging or producing a minimum test case?
It turns out the issue was with koa-proxy: it doesn't correctly forward multipart POST requests. I fixed it by switching to koa-proxy2, and I will look into contributing a fix to the koa-proxy project.
I am running Xpage Application on Domino Server 8.5.3 FP1 Windows 64bit.
We are sending the bills(documents) around 2500 users. during testing ,this application works fine without any error. When we rollout the bills to user. All users are trying to open the application.
It is throwing the following error. But Application still works. At some point of time, Application gets slow and http hang. I have do restart of HTTP. Then it works fine.
I am not able to find the cause whether any error in the code or because number of users are accessing the application increases.
06/04/2014 10:58:53 AM HTTP JVM: CLFAD0211E: Exception thrown.
For more detailed information, please consult error-log-0.xml located in D:/Lotus/Domino/data/domino/workspace/logs
And sometimes this is also throwing ,
HTTP JVM: CLFAD0141E: Error processing XPage request. For more detailed information,
please consult error-log-0.xml located in D:/IBM/Lotus/Domino/data/domino/workspace/logs
Please help on this query.
You should start with what Paul suggests. If you haven't already downloaded and installed LogReader (by Jakob Majkilde), then you should. It is a database on your server that will read the various error file types and show them for you in an easy way. You can find it here: http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20Log%20File%20Reader
From these log files you will then have to look at where the system complains about problems. Did you write the code in Java or Serverside Javascript (SSJS)? You have options to debug both of these (although I cannot remember if you can debug SSJS in version 8.5.3 - it may not be available until version 9.0). But you could always add a println in the code near where you think it breaks ;-)
/John
At some point of time, Application gets slow and http hang. I have do restart of HTTP. Then it works fine.
As mentioned by Paul + John, no one is going to be able to give you an exact answer from the posted message.
As you mention the application gets slows and hangs, I would also recommend watching the XPages Masterclass.
It is approx 4 hours of videos, and goes into detail on how to debug your application for performance issues using the XPages Toolbox.
Again this isn't an exact solution. You will need to use the XPages toolbox to drill down on your code/JVM to see where it is slowing down/hanging.
Posting the stacks from the error-log-0.xml log file might give some hints, but with performance/hangs it's rarely that simple to find.
Now Application is working without issue. I have just included exception handling in all ssjs.
Now it is not throwing error.
Thanks for all your help and time.
Part of this problem might be that there's too much discussion on the client side for me to see wood for the trees.
Anyway, here's what I want to do. I need a platform independent server-side implementation of WebSockets. I'd like it to run in NodeJS.
Now, 99% of what I've found on this topic talks about socket.io. But so far as I can tell, that is not WebSockets, it's a special "extra" protocol in its own right. I need something that works "by the (not-yet) standard". There's a good reason for that, and it's non-negotiable, trust me on that.
So, I tried WebSocket, but that requires (or appears to require both python and, worse, Visual Studio) to run on Windows. I need something that is platform independent and doesn't need special things like this.
I also tried node-websocket-server, but I can't get that to work at all. The example on the main page fails for me. It seems to accept a connection, but the client doesn't see it, neither side gets to send anything, and the client immediately sees the connection as closed. Indeed, all I ever get is a "connection" callback, and then it seems to die. Running in debug mode didn't tell me anything useful, except for some internal error about some object or other not having a flush() method. I half-suspect this is a defunct project?
So, I'm out of ideas. Is it possible to persuade socket.io to work purely by the (non)spec for WebSockets? Is there a way to get node-websocket-server to behave that I've failed to find. Is there a way round the Visual Studio dependency in websocket, or is there some other NodeJS based tool that meets all my requirements?
Oh, one other thing, I'd like the tool to coexist peacefully with "connect" as I'm using that for my regular document serving.
I had the exact same problem that you're facing at the moment when I tried to use Socket.IO on a different platform without a direct port of the client (and without the motivation to port it myself).
I ended up moving my code to use ws which is a standards based websocket implementation for node without the added sugar from socket.io.
It works extremely well in my case over several different platforms but you would need to rework most of the connection/reconnection code etc.
Website : link
GitHub : link
NPM : npm install ws
Socket.io uses WS under the covers so you may hit the same installation issue on Windows. You may find that it complains that you need to install Visual Studio 2010 for the ws component to work.
However, you can configure the version of Visual Studio used by node-gyp that runs the C++ compiler via an environment variable.
Examples:
set GYP_MSVS_VERSION=2012 for Visual Studio 2012
set GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition')
For the full list see
- https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
This is a painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed which many non-dev end users will never have. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem and not have to force Windows node users to tweak their environment or download anything else.
Feel free to add your vote at:
https://github.com/joyent/node/issues/8005#issuecomment-50545326
NOTE: The Joyent team have indicated that socket.io will fall back to using a slower implementation when compiling ws fails. In other words your code will still run - just not as fast. This is not clear for end users performing an install of any app that depends on socket.io or ws as it display red error text during the install process leading users to assume that the install failed, when in fact it will work albeit slowly.