chronicle directory-listing.cq4t release - chronicle

I've upgraded chronicle-queue binaries to the latest version and notice a new file (probably it's not that new but I haven't seen it before) - directory-listing.cq4t.
I have a test creating a regular queue with SingleChronicleQueueBuilder then doing some operations and closing it. As the last step I'm force-deleting the whole folder with the data.
Problem is that directory-listing.cq4t is locked by java process even when queue is already closed. Note that data file itself is deleted without any problems.
There is a test in chronicle code base SingleChronicleQueueTest.shouldCreateQueueInCurrentDirectory which can demonstrate the above behavior as file is not being deleted and delete() call returns false (but result is never asserted)
Is it a known problem or Iā€™m doing it wrong? (queue release)

Thanks for the bug-report. This looks like an oversight where the directory listing was not being closed correctly.
I've fixed that problem in master. Can you build the latest from github and re-test?

Related

Openwrt : file modifications of /etc/config on custom-compiled firmware not saved after reboot

I am building an openwrt firmware for an old mt7620 board for commercial purpose (captive portal)
I am encountering a strange behaviour when I try to save updated config files. I am trying to figure out the reason.
This is an example of what happens :
1 ā€“ FIRST TRIAL :
I compiled an old Chaos Calmer 15.01 openwrt version. From the console, I go to the /overlay/upper/etc/config:
Before reboot
I modify or delete the existing files in the [..]/etc/config/ folder
I create a new file for example "test" in [..]/etc/config/
I create a folder "new_folder" with a file inside
After reboot:
changes are not kept or deleted files are back in [..]/etc/config/ folder
the new file for example "test" is still there
the "new_folder" with its file inside are still there
Finally :
if I delete the new files "test" and "new_folder", after the reboot they are effectively deleted
So to sum-up : only pre-existing files in [..]/etc/config/ folder are reverted back at each reboot.
2 ā€“ SECOND TRIAL :
I compiled a firmware of the same version without UCI, when I modify the files in /etc/config/, changes made manually are kept after reboot, except 'wireless' which revert to its initial state.
It seems like some process involving UCI at startup use the original files and not the edited ones.
I took a look to the .sh scripts in /etc/init.d, /etc/rc.d, lib/config, lib/functions, lib/preinit... to see what is going on but its still not clear when and where config files are processed (even after looking at topics on the subject)
3 ā€“ THIRD TRIAL :
I managed to compile another firmware based on LEDE 17.01 to see if there are benefits. Unfortunately, I still have the same problem concerning the files in the /etc/config which always revert to their default value.
4 - FINALLY TO SUM-UP :
Is there a way to turn this behaviour off, or is it a kind of 'file protection' towards something that could be seen as 'currupted' by the system ?
Note :
I know that theses versions are very old and some people may recommend to upgrade it.
But, In regards to my constraints, I tried to update to openwrt versions >= 18.06. Each time I have kernel panics even by compiling with the custom changes I made that work with the previous versions (DTS file).
So, I am stuck with it for instance, I prefer having one problem at a time.
Sorry for the long post.
Thanks a lot, by advance, If someone have an idea or have already seen such a situation.
Best Regards.
Edit : Overlay at boot time
Overlay at boot time

Force Commit to GX Server

I have a few objects that need to be Committed to GXServer but for some reason I am getting a failure. The message is something like:
'Commit failed: At least Environment 'Java Environment' was modified in GeneXus Server since your last update. Please Update Knowledge Base and retry.'
When I go to the Update Tab in GXS for this KB it is empty - I am in sync. It seems like I am stuck - the Commit side says Update but the Update side says I am in sync.
I have been able to Commit all of the objects except the one listed in this error. In my case, I am sure I have the latest version of the object, so I need to know how to force this object to GXS.
I wanted to share with the Community the answer I received from Support as it solved the problem. If you run into this and have questions you can ask Support and they can give you more official details. This is my take on the situation.
If you know the object in the error should be Committed, you can make a change to a file in your running GX version to 'force' the Commit. Here are the steps I followed:
You should be able to Commit all objects except the one in question. It is best IMO to commit all objects normally and only have the object in error listed.
Close GX
In Windows Explorer find the GeneXus installation folder (something like C:\Program Files (x86)\GeneXus\GeneXus16U5)
Open the file GeneXus.exe.config for editing ( you may need 'Run as Administrator')
Search for </appSettings>
Above this line, add a line with this information
<add key="ForceCommit" value="true"/>
Save your changes
Open KB and Commit the object in question
Once the object is committed, close GX and remove the line from the config file so you are not forcing future objects up.
This force process should NOT be used unless you are in this situation, and it should not be a normal occurrence.
Also, make sure you change the correct file. One time I edited a file with a similar name by mistake (even the contents looked similar), and it did not work.
The last time I performed this was in GX 16 U5. I do not know what the original issue was that caused the conflict, but this was the way I was given to force the Commit.

Git for Windows - prevent .pack file date/time modification

I am using Git for Windows (version 2.15, but the same issue occurs in 2.14 and I think older versions as well) and I noticed a rather annoying behavior: When I perform some basic git operations*), the modification date of the .git/objects/pack/pack-*.pack file changes. The file itself remains unchanged, but the last modification date field gets updated, which causes my backup software to think the file was changed and needs to be added to my differential backup. Because my .pack files are rather large, this increases the size of my daily backups significantly. Is there a way to prevent this behavior? That is, keep the pack file completely unchanged, including its metadata, until I perform a git gc or git repack?
Unfortunately, I wasn't able to pinpoint which operation causes this behavior. When it happened today, I only used git status, git log, git add, git mv and git commit and nothing else and the date/time got changed, but when I tried to replicate the behavior on my yesterday's backup, the date change didn't occur. I guess next time I will run Process Monitor and watch accesses to the file, but in the meanwhile, does anyone have an idea of what might be causing this problem? Thanks.
Instead of referencing your Git repo itself for your backup program to process (with the date issue), you could have:
a task which does a git bundle of your repo (that generates only one file)
your backup program would back up only that one file.
That way, you bypass entirely the modification date issue for those pack files.
You can either save and keep only one copy of a full bundle of the repo.
Or make incremental bundles.
In the end it turns out that Edward Thomson's answer explains why no "real" solution is possible. However, to facilitate my needs, I wrote a simple Windows command-line application which scans through a tree of directories, locates possible Git repositories, locates their packfiles and changes the date/time of each .pack file to that of the respective .idx file. So far it seems to run OK. I did not encounter any garbage collection issues yet, anyway. I did not release the tool yet, because I rather suspect no one else cares, but if someone is interested, I can upload it somewhere.
Apparently, someone is interested. So the program is released as of now. Not on GitHub, but still as open source, under the 3-clause BSD license. Download the binaries here: https://www.pepak.net/files/git/gitpacksync-0.01.zip
and the source code here: https://www.pepak.net/files/git/gitpacksync-0.01-source.zip
If you try to disable this then you would be prone to see subtle bugs where objects that are still in use will disappear from your repository.
You had trouble pinpointing the exact operation because every operation that adds files will do it.
This is very much intentional - Git refreshes the timestamps of objects in the database (updating the timestamp on either loose objects or packfiles) to know when an object was last written. Whenever you create a new commit, it will update the timestamp on all the files that contain objects hat were referenced.
This is important as it helps the tools that remove data (like prune) avoid race conditions: an object may be dereferenced and then re-referenced. Prune will also look at the timestamp, so by touching the file, it will not be eligible for garbage collection.

Core Data hoses itself

Periodically I launch my app from Xcode to find Core Data errors due to an empty model file. The versioned model files are found in the main bundle but the model file still inits to nil. See my answer for partial workarounds but no solution to date.
I've verified that the files exist and are accessible using the access function. I've tried using initWithContentsOfURL and mergedModelFromBundles with the same result.
This happens randomly and I suspect something is changing the model file behind the scenes but I don't know what.
Restarting my computer seems to have solved the security related crash but this also necessitates removing the existing Core Data store file as it complains the existing one doesn't match the model file.
[UPDATE]
Restarting does not solve the problem. But reseting the current version of the Core Data model file did the trick. I changed it to an older version and then back. This question helped me think of this as something to try. Using mergedModelFromBundles: and versioning (CoreData) Still not sure what the root problem is.
[ANOTHER UPDATE]
I put a file monitor on the .xccurrentversion file in my Core Data momd file bundle to observe when the file is being touched. I've noticed that XCode (or some build tool) updates the .xccurrentversion file periodically when XCode comes to foreground (either when the project is opened or when it's been in background for a while). When it did this today it updated the file setting _XCCurrentVersionName to the main momd file bundle rather than the version file. I replaced the .xccurrentversion file with an older version and it launched. This would explain why reseting the current model version fixes this issue. I have no idea what the conditions are for XCode to update this file.

Visual-SourceSafe error - unable to finish writing a file

We use Nant to automate our builds. Everything was working fine until about a week ago when the rains caused our power to go out and the build server had to be re-booted. Now, we get the following error whenever we attempt a build:
<internalerror>
<type>System.Runtime.InteropServices.COMException</type>
<message><![CDATA[SourceSafe was unable to finish writing a file. Check your available disk space, and ask the administrator to analyze your SourceSafe database.]]></message>
<stacktrace><![CDATA[ at SourceSafeTypeLib.VSSItemClass.Get(String& Local, Int32 iFlags)
at NAnt.Contrib.Tasks.SourceSafe.GetTask.ExecuteTask()]]></stacktrace>
</internalerror>
We ran the Analyze utility on the VSS database and there appears to be plenty of room on the build server, but no luck. Any ideas? I'm at a loss.
My problem was that the current file was empty... I wrote a comment on it and everything worked ok
Ok, here is the resolution. It turns out that somehow, the version of an app.config file that was referenced in the build script was corrupted (all the previous versions, actually), which caused the VSSGet error. Updating the version to the current version fixed the errror.
I had this issue when I tried to migrate a Source Safe database to Subversion, using VSS2SVN.
This error is related to the message
There is a diff chain size mismatch in file '' (bdaaaaaa) at version (versions earlier than that version can no longer be retrieved from the database).
that may be reported by the Source Safe tool analyze.exe.
If you look into the history of the file and try to Get a version that is older than the one reported by analyze.exe, the message of this question is shown.
Microsoft provided hotfix KB927887 for cases where this was caused by XML files toggling BOM inclusion, but I did not try to apply it.
See also Message: SourceSafe was unable to finish writing a file

Resources