Service fabric debugging - reliablecollection persisted? - azure-service-fabric

I can't seem to find any information on whether a ReliableCollection, specifically ReliableQueue is persisted between debugging sessions in visual studio. It does not seem like it is. I think it's because the application is removed and then re-added during debugging. Can anyone confirm this?

Yes, the default behavior is to remove the deployed application after the debugger stops.
Fortunately, you can change this.
There are two ways this can be done: Launch your app from VS without
the debugger attached (Debug -> Start Without Debugging [Ctrl+F5]).
Obviously, this would require you to manually attach VS to your
service processes in order to debug them. When you detach VS from the
processes, VS will not remove the application in this scenario.
With
your Application (.sfproj) project selected in Solution Explorer, go
to the Properties window and change Application Debug Mode from
"Remove" to "Auto Upgrade". This prevents VS from removing the
application after debugging. However, it also causes another change in
behavior in that it will automatically upgrade your application each
time you launch it from VS. The added benefit of auto upgrade is that
your application state will be maintained across multiple launches
from VS. This may be desired or not. There is not a setting that
allows you to both prevent application removal and not do an auto
upgrade.

Related

How to automatically terminate last instance when running or debugging in VS Code

Coming from Eclipse, I am very used to the option to terminate the possible old and running instance of the code I'm working on. With VS Code, I instead have to select the console, press Ctrl+C, wait for the process to end and only then can I launch a new instance via Ctrl+F5 (same for debug/regular F5).
I was surprised to find no such option in VS Code, am I missing something or is this feature simply not supported ? If this is possible to configure somehow, how would I go about it ? Multiple tags because I'm not sure which part of VS Code would be responsible here. I am specifically developing in Java, if that is relevant.

After launching app, it takes 30+ seconds before able to access elements through pywinauto

I'm testing a custom WPF application using pywinauto.
When connecting with win32, I don't get any dependents, so I'm connecting with uia.
After I launch the application, I can immediately connect with pywinauto, but it takes 30s+ before I'm able to access any elements. After the initial delay, interacting and searching for controls is quick.
I call windows() as a way to wait until the application lets me interact with it.
main_app = Application(backend="uia").connect(path=APP_PATH)
main_app.windows()
On investigation, the hanging seems to occur during: "application.py" > "windows" > "findwindows.find_elements(...)" > "element.children(...).
If I open the application, and wait for 1 minute, and then run the script, then it occurs almost immediately. And finding subsequent controls is quick.
I appear to see this same behaviour when using inspect.exe to view the hierarchy. If I refresh immediately after opening the application, it takes 30s+ to show anything. But If I wait a minute before refreshing, it updates immediately.
I was wondering if someone else had experienced this before, and what might be the cause/solution.
I am running:
Windows 10, python 3.8.3, pywinauto 0.6.8
Sometimes setting an application as an firewall exceptions helps them boot/open faster.
Granting Firewall exception on Windows 10 for an application:
Go to Control Panel.
Click Windows Firewall or Windows Defender Firewall option.
Choose option "Allow an app or feature through Windows Firewall" (on left side).
Select your application in the list or click on Add Another App to find it and add it to list.
After debugging some more, I have resolved the issue, although it's not clear to me what the root cause actually was.
The custom application I'm testing launches a background application as a non-visible console. Testing showed that not running this background application allowed me to conenct immediately. Running the background application by itself would cause the same delay in inspect.exe loading.
The application was a dotnet framework application, that in theory was a console only application, but had code supporting a WPF interface (which was not displayed). By removing the WPF aspects of the project, I was able to build the application as a purely console application, and I no longer experienced the earlier delays.

hot swapped warning without making any changes (Spring tool suite 3.9)

When running my code in debug mode, I keep getting 2 error messages:
Could not delete [path_to]\productiondb.log. May be locked by another process
I don't know what process might be locking it. It comes when I make changes to the code while my Pivotal tc Server is running in debug mode, but it dosent seem to create a lot's of trouble. Sometimes however, I get this warning:
Also due to some changes. I usally just restart the server and move on. This isen't the real problem, the real problem is that I get these messages when I havent doen any changes. Somethimes it accures when I run a certen part of the code, other times i occurs when I open certen codes in sts, however, it doen't seem to stop at the same place twice.
I am suspecting that this has something to do with git. I am using git to change between versions and doing tests. So I am thinking that STS has some of the code in memory from before I changed branche with git, and isen't updating it before I run or open the file with that code. But I am rather new to both sts and git, and can't be certan that it would work that way. If it is, does anyone know how to update sts after I have changed branch? If it is not, does anyone know what might causing it?
If you run an app in debug mode, the Eclipse Debugger tells the application when code gets changed and tries to use the debug API to swap in the new code into the running application. This is especially useful if you debug your code, hit a breakpoint, step through the code, fit the issue, change the code, and press save. At that moment, the Eclipse compiler updates the class file and tells the running JVM to swap in the new code. If that succeeds, the debugger will jump back to the last stack frame and the execution of your app will continue with the beginning of the method that you entered. This allows you to directly continue to debug and step through the updated code without restarting the app.
While this is a great feature of the JVM, it is very limited in terms of what scope of changes to the classes the JVM can deal with while doing this hot-swap. It is usually limited to method implementations. So adding new methods, adding or deleting members of the class, etc, are not supported. As a result, the above screenshot will appear. It means that the JVM wasn't able to hot-swap the changed code and will continue to run with the previously loaded code instead of the changed one.

Are there more explicit commands/toolbars and feedback for Eclipse for Android?

I'm new to Eclipse. I may need a better understanding or a plugin that would provide me with features described below. While doing some Android development, and I while making changes to my code at one point Eclipse warned me that this emulator doesn't support hot-swapping and if I want to disconnect. I'm used to see status in either the toolbar or in some log from Visual Studio. Is there a way to see this feedback in Eclipse?
My problem is that there are quite much implicit stuff in eclipse I would like get feedback of and control, like whether I'm
connected or not to a device,
if I'm attached to a process on it or not with debugger,
some kind of build log with a timestamp so I know it happened,
the automatic uninstalling and installing of the project on the device
which project is "active" ("featured") in "Run" and "Debug" buttons/configurations
Is there a plugin that can give me explicit commands over these automatic features? Like a toolbar or command. What I would expect of this tool:
be able to indicate the current status (eg. currently connected or not)
gives me control to eg. connect
gives me control to eg. disconnect
Preferably on a toolbar, as I know some of these are available as menu commands.
Furthermore I tried to configure my toolbar by Window menu -> Customize perspective..., but pin-pointing the features I want made my Eclipse put empty space up for the buttons I disabled, and next time I got to the same config screen it got the checkboxes wrong and displayed some stuff active what was actually disabled.

GWT development with Eclipse

I am developing a GWT app using eclipse and I was wondering if there is a way to hot swap client code changes I make without having to do a full Google Compile each time. Currently when I modify my code, I do a Google compile and then click the Reload server button, then I refresh my browser to pick up the changes. This is starting to get a bit painful as it takes 10 - 20 sec to do a full compile when I may have only modified a UI string so was wondered is there a quicker way.
If you want to see your changes in client code, hit the refresh button in your browser.
If you need debug functions, use Debug As => Web Application. It may be a little (or a lot) slower to start depending on a browser.
If you don't need debug functionality, use Run As => Web Application. It starts faster. You will still see all errors in Development Mode and Console tabs.
If you make changes to server-side code, you have to reload the web server, using the dedicated button of the dedicated Development Mode view in Eclipse.
You never need to recompile unless the plugin tells you to do it.
See https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideDevMode
To add to Andrei's answer Assuming we are changing functionality invoked on button click.
1) We usually change lines of code in the function invoked and click the button again in the UI. No need of reloaing the entire application using refresh button.
2) If the change involves code that cannot be hotswapped - example class changes like adding new a class variable, then you need to refresh browser. You can sometimes ignore the eclipse warning complaining that it cannot hot-swap.
3) If you run out of memory then you need to close and relaunch dev mode.
4) If your server side is hogging memory then it might be better idea to use external server rather than jetty to avoid time consumed on server restart for every dev mode launch.