Comments (2)
Thanks for creating the test code. I am able to reproduce this in your test if I take out the python and just try to run a batch file that prints the time. I'm going to look into why it fails a bit more before putting in a fix.
from starcraftaitournamentmanager.
I changed the test code (see below) to print out the error stream from the process (only on even calls, otherwise the delay prevents the error) and found that the error message was:
"The process cannot access the file because it is being used by another process."
I thought this meant the problem was too many calls to access the same batch file, but if I use two different batch files for each pair of runs the problem still happens. If you change the code to produce 200 unique output files it will successfully create all of them. I believe the issue we're seeing with the test is just multiple processes trying to write to the same output file.
I don't know what the actual problem happening in the Tournament Manager is, then, since the process to run "run_proxy.bat" is only created once. The only other process created before that in the startStarCraft() method is one that renames the character files (ClientCommands.Client_RenameCharacterFile()).
Could you try adding some similar code to log the error message (if any) in your actual bot setup?
And did I understand correctly that adding the 10ms delay stopped the crashes completely?
public class Main{
public synchronized static void runCommand(int id, boolean printErrors){
try
{
String idString=Integer.toString(id+1);
String command="D:\\test\\AI\\run_proxy.bat";
String windowsCommandPrefix = "CMD /C ";
String completeCommand = windowsCommandPrefix + command;
System.out.println("\n" + idString+ " "+ completeCommand);
Process proc = Runtime.getRuntime().exec(windowsCommandPrefix + command);
if (printErrors) {
BufferedReader br = new BufferedReader (new InputStreamReader(proc.getErrorStream()));
String line;
if ((line = br.readLine())!= null) { //or while to print multiple lines
System.out.println(line); //log to a file instead?
}
}
//Thread.sleep(10);
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args){
try{
for(int i=0;i<100;i++){
runCommand(i, false);
runCommand(i, true);
//Thread.sleep(2);
}
}catch (Exception e)
{
e.printStackTrace();
}
}
}
from starcraftaitournamentmanager.
Related Issues (20)
- TM overwrites bwapi.ini HOT 1
- load other dll at run time
- Possibly Starcraft UDP Connection Issue? HOT 8
- ManagerClientThread Object Streams could not initialize HOT 2
- client occasionally getting stuck in Status: SENDING HOT 10
- File I/O not synchronized immediately between rounds HOT 6
- replay is twisted HOT 3
- Suggestions for the AIIDE competition and/or ladder HOT 9
- Bugfixes to Tournament Module permissions for BWAPI versions 4.2.0 & 4.1.2 HOT 4
- Add support for BWAPI 4.4.0 (but not 4.3.0 because it crashes a lot) HOT 5
- some confusing problems HOT 3
- Use the latest Microsoft Visual C++ x86 redistributables HOT 7
- Game Speed slider setting in game lobbies HOT 1
- Questions about Cherrypi HOT 1
- Can't upload bot HOT 1
- Header links don't work without JS handlers
- Is there some way let StarcraftAITournamentManager enable CompleteMapInformation? HOT 1
- 4.4 Tournament Module mistimes client bots HOT 5
- Add bot packs from all AIIDE competitions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starcraftaitournamentmanager.