w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Laravel & PHPUnit : allow process isolation to prevent Mysql Too many connections error
I would take a look at Mocks and remove your MySQL dependency: https://github.com/padraic/mockery#mocking-public-static-methods Going forward, I would actually suggest focusing more on testing your SQL. My firm recently spent a good amount hiring DBAs that really turned our legacy slowness around.

Categories : Mysql

How can I share share read/write access to a file within the same process, but forbid it externally?
Files are generally not for multi-user interactions such as this. A database is what is needed here. Then the data you need written can be saved to the database and all the synchronous handling would now be the databases responsibility. If you still require a file, after the data has been input, it would be an idea to generate the file when needed based off the database data.

Categories : C

Can Azure Worker Process stop itself?
So I think you're referring to Worker Roles, right? A worker process would simply be something you run in your app (like a thread, a method, something). Azure Worker Roles are full VMs. Assuming that's what you meant: The new announcement about stopping VMs does not apply to Web / Worker Role instances; it applies to Virtual Machines. And those can be stopped easily via REST call (or much easier via PowerShell that wraps the REST call). You could make that call from a Virtual Machine, which would effectively shut itself down, but I'm not so sure that's a sound idea. If you take that approach, it will be very hard for you to track the role-stop progress, since you would have just stopped the VM that made the call.

Categories : Azure

Are apache's worker configuration and mod_wsgi's daemon mode related?
For a start, go watch the following talks for a partial explanation. http://lanyrd.com/2013/pycon/scdyzk/ http://lanyrd.com/2012/pycon/spcdg/ In short, the Apache worker processes proxy requests to the mod_wsgi daemon mode processes if daemon mode is actually configured and the WSGI application delated properly to run in it.

Categories : Apache

How many instances of a web application are running in one worker process?
I'm not sure if this applies to you, but HttpModule Initialize methods are called more than once because even though there is only one Application instance. One HttpApplication can spawn multiple HttpModule instances, so make sure those initializations are thread safe. Application_Start and _End will fire only once per site start and stop with your current settings, so that will not be the issue. If you are using the HttpContext.Cache object, you might have the issue mentioned in this answer: HashTable in HttpContext.Current.Cache If you want, you can try using WinDbg and get a dump of what is going on in your process but that is a really heavy-handed tactic that probably won't shed as much light as just looking through the code. Not until you look at it a little harder, and are still s

Categories : Asp Net

Mime type error with Meteor and Recorder.js Web Worker in Production Mode
Use the Sources tab in chrome debugger (or your tool of choice) to see the uglified js file, saved it to disk, and poked around in there. There is probably a de-uglifier available somewhere. Try loading the ugly file in an editor and poking around. At least that's something... That file is probably present in the .meteor resources, but I've given up before I found it. The create a bundle for production tool should make that more obvious...

Categories : Node Js

What is the relationship between Application Pools and worker process threads?
Yes, each application pool is typically a single process1, but can contain multiple threads. You can assign multiple sites to an application pool, and those sites will all run under the same process, however they will run under different "app domains", which are security contexts that separate the code of one site from another, even if they're running on the same app pool. Two users hitting the site at the same time can run on different threads, meaning they can run concurrently. That means any logging can have values interspersed. You might want to add a session value to your logging so you can sort based on session. App pool restarts (recycling) are normal, 20 restarts in a day does not seem unusual. They can happen multiple times per day, and IIS controls when app pools are restar

Categories : Asp Net

Perl's worker don't process connections, waiting on a futex
According to futex man page: This system call is typically used to implement the contended case of a lock in shared memory, as described in futex(7) So my first question: is your Perl script using "Perl Threads" and are you having contention on a shared memory variable?

Categories : Perl

ImportError being generated when trying to run django-celery worker process
I'm pretty sure this line is your problem: File "C:sitescorecrmpeoplemodels.py", line 163, in <module> UserProfile._meta.get_field_by_name('username')[0]._max_length = 75 While you're still busy importing from people.models, this line (in particular get_field_by_name) forces Django to evaluate the model and setup all relationships between that model and it's related models. This, in turn, forces an import of Customer in people.models, while you're still busy importing that exact model. This is what results in an ImportError. For a working solution you'll need to post your models.py. Why does this error only occur with celery? I can't say for sure without some more information, but my best guess is that Celery handles importing everything slightly different (Django probably

Categories : Django

Try to write from the background worker to a textbox in the GUI
Using the dispatcher like that pushes all the work back to the UI, you should only use the dispatcher to refresh the text every now and then, never push RandomDoWorkMethod using the dispatcher. Also consider using binding (also see notes on BackgroundWorker and ProgressChanged).

Categories : C#

PHP process takes a long time to finish, how can I farm it off to a worker
PHP cant multi-thread, it can fork - but only when not going through apache! Look at using a Worker system, like PHP-Resque It makes life so much easier :)

Categories : PHP

Worker process not releasing memory and Oracle connection not closing
Once I ran into the same issue and I bumped into this article and this one. I exchanged a few emails with the author (Paul Wilson) and he helped me to understand the problem with large objects which are allocated in memory in a "Large Object Heap" and it never gets compacted. This is what he told me: Larger objects are indeed allocated separately, where large is something around 60-90 KB or larger (I don't remember exactly, and its not officially documented anyhow). So if your byte arrays, and other objects for that matter, are larger than that threshold then they will be allocated separately. When does the large object heap get collected? You may have ran into statements about there being several generations of normal memory allocation (0, 1, and 2 in the current f

Categories : Vb.Net

How to access kernel mode memory in user mode application in WinCe7
I'm not sure if this will help considering you're on Win CE 7, but in Windows 7, I have a driver that maps a kernel mode address to a user mode address before returning the resulting user-mode address to my application. void *userSpaceAddr; // Allocate the MDL describing our kernel memory pmdl = IoAllocateMdl((PVOID)&my_heap_var, (ULONG)size_of_my_heap_var, FALSE, FALSE, NULL); if(!pmdl) { DbgPrintEx(DPFLTR_IHVVIDEO_ID, DPFLTR_INFO_LEVEL, "Error on IoAllocateMdl. Returning from driver early. "); return STATUS_INSUFFICIENT_RESOURCES; } MmBuildMdlForNonPagedPool(pmdl); userSpaceAddr = (void *)MmMapLockedPagesSpecifyCache(pmdl, UserMode, MmWriteCombined, NULL, FALSE, LowPagePriority); userSpa

Categories : Windows

How do I deal with cases when Process.Kill() yields "access denied" because the process is terminating?
Use the command line C# to kill the task, for example Taskkill /F /IM ExeName.exe. If you do not have a persmission to kill the task than also force kill will not help. More info Please check http://www.c-sharpcorner.com/UploadFile/8ea152/kill-process-from-the-command-prompt-in-windows-8/ here an example how to run command line in C# Run Command Prompt Commands Greetings

Categories : C#

The process cannot access the file 'x' because it is being used by another process while deleting saved image by application
This is explained in the documentation for Image.FromFile: The file remains locked until the Image is disposed.

Categories : Vb.Net

FileMode and FileAccess and IOException: The process cannot access the file 'filename' because it is being used by another process
You need to release control of the file from Program A. Try closing or disposing the streamwriter when you finish. Or you might attempt using as is described in the answer to this question: Releasing access to files

Categories : C#

Error "The process cannot access....becuse it is being used by another process. " in Delete Image
When you use Image.FromFile, that will open a file handle to that file and keep it open until the image is disposed. You should: Only call Image.FromFile once and reuse the object in Setimage (you're loading it twice in a single if condition...) Dispose of every Image when you're done with it Dispose of the old BackgroundImage before you set the new one So long as you dispose of every Image which is related to the file before you delete the file, you should be okay.

Categories : C#

Is lock or volatile required when worker threads write non-competitively to local or class variables?
Writes to reference types (i.e. Object) and word-sized value types (i.e. int in a 32 bit system) are atomic. This means that when you peek at the values (position 6) you can be sure that you either get the old value or the new value, but not something else (if you had a type such as a large struct it could be spliced, and you could read the value when it was half way through being written). You don't need a lock or volatile, so long as you're willing to accept the potential risk of reading stale values. Note that because there is no memory barrier introduced at this point (a lock or use of volatile both add one) it's possible that the variable has been updated in the other thread, but the current thread isn't observing that change; it can be reading a "stale" value for (potentially) q

Categories : C#

Access to Delayed::Worker instance
Your best bet would be to use Delayed::Worker.logger.[info|error|warn|debug] "going to do x" with some formatting :) because say internally uses the same logger object Edit Delayed::Worker.logger.[info|error|warn|debug] "#{Process.pid} at #{Time.now} => going to do x" Hope this help

Categories : Ruby

IOException The process cannot access the file because it is being used by another process when using XDocument
You can still use XDocument and an XmlReader: XDocument doc; using (var reader = XmlReader.Create("C:/Trio Scripts/example.xml")) { doc = XDocument.Load(reader); } When the using block completes for the reader, then the file handle should be closed. Update: Maybe the behavior of XmlReader.Create(string) doesn't open the file in the most minimal fashion. In case that's what's causing the exception, try this more explicit code specifying file permissions: XDocument doc; using (var stream = File.Open("C:/Trio Scripts/example.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var reader = XmlReader.Create(stream)) { doc = XDocument.Load(reader); }

Categories : C#

System.IO.IOException: The process cannot access the file because it is being used by another process
Short answer: Try Thread.Sleep(100) before you read and then read as fast as you can. I thought that by setting the FileAccess.Read I should be able to always read the file? By setting FileAccess.Read you are just saying that you need to read from the file. By setting FileShare.ReadWrite you are saying you are comfortable with the 3rd party reading and writing to the file while you read it. The exception means that the 3rd party is not comfortable with you reading while they are writing. Your first bet is to check if you can configure the 3rd party process to allow other processes to read while they write, but be aware that reading from a file that is being written to can be troublesome. How can I make sure that this doesn't cause an exception, or do I need to just loop around un

Categories : C#

The process cannot access the file 'xxx' because it is being used by another process when Exporing to PDF using ReportViewer
It was solved by seting reportviewer = null and adding a finally to the catch public bool Export(string accountNumber, DateTime settlementDateTime, string PDFfileName, out string errorMsg) { bool success; ReportViewer reportViewer; Warning[] warnings; ReportParameter[] rptParameters; string[] streamids; string mimeType; string encoding; string filenameExtension; byte[] bytes; FileStream fs ; success = false; errorMsg = string.Empty; fs = null ; reportViewer = null ; try { Console.Out.WriteLine(String.Format("Generando extracto para la cuenta "{0}" de la fecha {1}", accountNumber, settlementDateTime)); reportViewer = new ReportVie

Categories : C#

Getting Windows error 32 process can not access file it is used by another process
Something is holding a reference to the file you try to move. Place a try/except block around the shutil.rename and print out which file causes the problem. When you find out which file causes the problem find out who is holding a reference to it. One way to find who is holding a reference to a file is either using Process Explorer or Unlocker Update: I took a look at the code of the ID3 library and it seems that, if you pass in a filename, it doesn't close the file, EVER :D You should do something like: with open(filename, 'rb') as f: tags = ID3(f) # do your stuff shutil.rename(filename, ...)

Categories : Python

The process cannot access the file because it is being used by another process - using static class
In your MakeThumbnail methods, make sure you're calling Dispose() on the Image types. That or use the using syntax: using (Image img = Image.FromFile(ImgIn)) { // Your code }

Categories : C#

Access any background worker created in runtime
well, that's rather easy. put the BackgroundWorker as a member in your form and then you can access it from everywhere: BackgroundWorker bg; public Form1() { bg = new BackgroundWorker(); } private void button1_Click(object sender, EventArgs e) { if(bg.IsBusy) { // show the message } else { bw.WorkerReportsProgress = true; bw.DoWork += delegate { SaveDetails(); }; bw.RunWorkerCompleted += delegate { MessageBox.Show("Completed"); }; bw.RunWorkerAsync(); } }

Categories : C#

Process Cannot Access the file "Path" because it is being used by some other process
I've been there before, maybe you could try to do this : public bool FileIsLocked(string strFullFileName) { bool blnReturn = false; System.IO.FileStream fs = null; try { fs = System.IO.File.Open(strFullFileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Read, System.IO.FileShare.None); fs.Close(); } catch (System.IO.IOException ex) { blnReturn = true; } return blnReturn; }

Categories : C#

The process cannot access the file 'C:someDesktop2011-11-23 15.47.36.jpg' because it is being used by another process
The problem appears to be that you are specifying FileShare.None. By doing so, you are making it so the file cannot open if any other process also has that file open. From the MSDN article: Declines sharing of the current file. Any request to open the file (by this process or another process) will fail until the file is closed. If you just want to open the file read-only, regardless if any other process is accessing the file at the same time, you probably want to specify FileShare.Read: Allows subsequent opening of the file for reading. If this flag is not specified, any request to open the file for reading (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the

Categories : Vb.Net

"The process cannot access the file because it is being used by another process" error
I would suggest making the filename something more generic so appending a timestamp or something, but additionally, in the using call fstream.Flush() before fstream.Close()

Categories : C#

error The process cannot access the file because it is being used by another process
You just have to add using System.Threading; at the top of cs page.. And add Thread.SpinWait(6000); at the top of text where it is showing you an error. Try this and if u need any help tell me.

Categories : C#

Heroku worker dyno giving R14 errors - problems with memory management - rmagick memory limit options
I finally found a solution. The problem was with rmagick. It gets all the memory it sees available. It doesn't matter if you use a 2X worker dyno instead of a 1X one. It grows to the maximum available resources. So, we have to set a limit. But in my case not all the limits worked. You can make a system call directly this way: convert -limit memory 0 -limit map 0 list_of_input_files output_file This way, you avoid to use the memory cache, going directly to the disk cache. This is the only way I've found to avoid R14 errors in heroku. With other combinations like -limit memory 32 -limit map 64 or similar, it always gave me errors. I took the idea from here. Of course, you could always use the rmagick library with this lines, however it didn't work for me and I did use the syscall approac

Categories : Ruby On Rails

Celery worker hangs on ZEO database access (race condition?)
Do not save an open connection or its root object as a global. You need a connection per-thread; just because ZEO makes it possible for multiple threads to access, it sounds like you are using something that is not thread-local (e.g. module-level global in databases.py). Save the db as a global, but call db.open() during each task. See http://zodb.readthedocs.org/en/latest/api.html#connection-pool

Categories : Python

Where to save temp files for windows azure website, and access them from worker role?
The answer would really depend on where the web app is running, and I'm thinking this question may end up getting closed due to the broad nature of it. But... In general, you should consider using blob storage for your images. This way, any compute instance in Azure can access it, whether in Virtual machines, web/worker role instances, or Web Site instances. As for 1-hour access, you can easily set up Shared Access Signatures which expire in an hour. You can then have these links embedded in your html output, and have your users direct-access the images. As for deleting, I'm sure there are lots of techniques. One such technique is to place a "delete blob" message, for a specific blob, on an Azure queue, with an initial invisibility of 1-hour. Then you can have a background task reading fr

Categories : Azure

the process cannot access the file 'xxx.xml' because it is being used by another process
It looks like you are never closing your reader, you need to call xr.Close() at some point. Or as Johan suggested, wrap it in a using statement: using (XmlReader xr = XmlReader.Create(Userpath, xrs)) { //Setting the Root element XmlRootAttribute xRoot = new XmlRootAttribute(); xRoot.ElementName = "Registration"; xRoot.IsNullable = true; XmlSerializer deserializer = new XmlSerializer(typeof(Registration), xRoot); Registration UserDetails = (Registration)deserializer.Deserialize(xr); Users = UserDetails.Users; foreach (var varuser in Users) { if (username == varuser.Username) { strUsername = varuser.Username; return true; } } i

Categories : Asp Net Mvc

the process cannot access the file as its being used by another process
I cannot find this now, but I remember from one of my previous projects that use of using in this case doesn't work. So, drop all of the usings and manage the file closing manually.

Categories : C#

The process cannot access the file '*.Yap' because it is being used by another process C#
I used to run into this with SQLAnywhere. If I had the SQLAnywhere management console open with a connection to the database at the same time my C# program attempted to open the database, it would give me this message. While your database engine is different, it may be a similar issue: you have an administration tool open at the same time your C# program is trying to open a connection, and only one is allowed at a time.

Categories : C#

"The process cannot access the file because it is being used by another process"
You need to close your StreamReaders for one thing. StreamReader file = new StreamReader(@_bundlePath + _bundleInfo.BundleName); You need to close the StreamReader object, and you could do this in a finally block: finally { file.Close(); } A better way is to use a using block: using (StreamReader file = new StreamReader(@_bundlePath + _bundleInfo.BundleName)) { ... } It looks to me like you are calling GC.Collect to try to force the closing of these StreamReaders, but that doesn't guarantee that they will be closed immediately as per the MSDN doc: http://msdn.microsoft.com/en-us/library/xe0c2357.aspx From that doc: "All objects, regardless of how long they have been in memory, are considered for collection;"

Categories : C#

Debug worker project run as a process from another project in VS
You don't give much info about the interaction between the gui and the worker, but if attaching to the process is too hard (typically beacuse the worker only runs briefly), a more usable scenario is to add a configuration option to the gui to add an extra argument to the worker command line, on which the worker responds with a DebugBreak. For example the worker's main would be var args = ParseArguments(); //check if string 'WaitForDeugger' is on command line if( args.RequestsDebug ) System.Diagnostics.Debugger.Break(); .... And the gui invokes the worker like this: var args = GetArgumentsForWorker(); if( someSpecialDebugOptionEnabled ) args += " WaitForDeugger"; Process.Start( "worker.exe", args );

Categories : C#

I do not understand why this worker cannot spawn a sub-worker in IE10 HTML5
I'm in about the same boat. My plan is to load a subworker from another doamin or file:// protocol because you cannot load one directly from a regular js script. I still need to test this, but I know that Workers/SharedWorkers are not subject to the normal Cross-Origin Restriction Policy, except** for when you're trying to load one (and hopefully only when doing this from a window script). Another method is to use window.postMessage to forward messages to a Worker that it has created in the other window. Alternatively, for my specific needs I am considering running a headless browser locally, a CDN, or a localhost "forever-server" with CORS enabled -- but this most likely still requires a window.postMessage(). Hope this helps, Tim! Post back if you find an answer, eh?

Categories : Javascript

NServiceBus Distributor Worker creates a new worker queue
When you start the endpoint, you'll see a warning logged, which explains the reason. 2013-08-26 18:56:48,473 [1] WARN NServiceBus.ConfigureDistributor [(null)] <(nu ll)> - 'MasterNodeConfig.Node' points to a local host name: [localhost]. Worker input address name is [Orders.Handler.810aa1ea-7eb4-47b3-b639-724c4498a999@SELEN E]. It is randomly and uniquely generated to allow multiple workers working from the same machine as the Distributor. Here's some documentation on the distributors and the explanation of the Scale out sample as well. http://particular.net/articles/load-balancing-with-the-distributor http://particular.net/articles/scale-out-sample. Check out the Hands on Lab (Intermediate lab), which will walk you through the Scale out lab as well. The Scale out lab will sh

Categories : Misc

How can I fix "responsive-design mode" problems for mobile devices (Wordpress theme)?
Step 1 : if you want to delete the mobile's view, just comment the end of the CSS file beginning with or delete and of course the following : /* * ------------------------------------------------------------------------------------------- * MOBILE BOTH VIEWS * ------------------------------------------------------------------------------------------- */ @media only screen and (max-width: 767px) { ... Step 2 : Then change, the condition to get the same design for tablets/smartphones : /* * ------------------------------------------------------------------------------------------- * TABLET PORTRAIT * ------------------------------------------------------------------------------------------- */ @media only screen and (max-width: 979px) { After, I don't know what you want on this

Categories : Iphone



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.