Skip to content

Commit 0c16198

Browse files
authored
Merge branch 'main' into pre-commit-update-codespell
2 parents 2dd1020 + 41b4f0a commit 0c16198

File tree

544 files changed

+31250
-4133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+31250
-4133
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ jobs:
164164
component/test_cpu_limits
165165
component/test_cpu_max_limits
166166
component/test_cpu_project_limits
167-
component/test_deploy_vm_userdata_multi_nic",
167+
component/test_deploy_vm_userdata_multi_nic
168+
component/test_deploy_vm_lease",
168169
"component/test_egress_fw_rules
169170
component/test_invalid_gw_nm
170171
component/test_ip_reservation",
@@ -236,7 +237,7 @@ jobs:
236237
237238
- name: Install Python dependencies
238239
run: |
239-
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid pynose
240+
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycryptodome mock flask netaddr pylint pycodestyle six astroid pynose
240241
241242
- name: Install jacoco dependencies
242243
run: |

.github/workflows/main-sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
uses: actions/cache@v4
5555
with:
5656
path: ~/.m2/repository
57-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
57+
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml', '*/pom.xml', '*/*/pom.xml', '*/*/*/pom.xml') }}
5858
restore-keys: |
5959
${{ runner.os }}-m2
6060

.github/workflows/sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
uses: actions/cache@v4
5757
with:
5858
path: ~/.m2/repository
59-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
59+
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml', '*/pom.xml', '*/*/pom.xml', '*/*/*/pom.xml') }}
6060
restore-keys: |
6161
${{ runner.os }}-m2
6262

INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Install tools and dependencies used for development:
2020

2121
Set up Maven (3.6.0):
2222

23-
# wget http://www.us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
24-
# tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /usr/local
23+
# wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
24+
# tar -zxvf apache-maven-3.9.9-bin.tar.gz -C /usr/local
2525
# cd /usr/local
26-
# ln -s apache-maven-3.6.3 maven
26+
# ln -s apache-maven-3.9.9 maven
2727
# echo export M2_HOME=/usr/local/maven >> ~/.bashrc # or .zshrc or .profile
2828
# echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
2929
# source ~/.bashrc

agent/conf/agent.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,9 @@ iscsi.session.cleanup.enabled=false
441441

442442
# Wait(in seconds) during agent reconnections. When no value is set then default value of 5s will be used
443443
#backoff.seconds=
444+
445+
# Timeout (in seconds) to wait for the snapshot reversion to complete.
446+
# revert.snapshot.timeout=10800
447+
448+
# Timeout (in seconds) to wait for the incremental snapshot to complete.
449+
# incremental.snapshot.timeout=10800

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,9 @@ protected void processRequest(final Request request, final Link link) {
800800
}
801801
commandsInProgress.incrementAndGet();
802802
try {
803+
if (cmd.isReconcile()) {
804+
cmd.setRequestSequence(request.getSequence());
805+
}
803806
answer = serverResource.executeRequest(cmd);
804807
} finally {
805808
commandsInProgress.decrementAndGet();
@@ -1021,6 +1024,8 @@ private void processPingAnswer(final PingAnswer answer) {
10211024
if ((answer.isSendStartup()) && reconnectAllowed) {
10221025
logger.info("Management server requested startup command to reinitialize the agent");
10231026
sendStartup(link);
1027+
} else {
1028+
serverResource.processPingAnswer((PingAnswer) answer);
10241029
}
10251030
shell.setAvoidHosts(answer.getAvoidMsList());
10261031
}
@@ -1087,6 +1092,9 @@ public void processOtherTask(final Task task) {
10871092
Answer answer = null;
10881093
commandsInProgress.incrementAndGet();
10891094
try {
1095+
if (command.isReconcile()) {
1096+
command.setRequestSequence(req.getSequence());
1097+
}
10901098
answer = serverResource.executeRequest(command);
10911099
} finally {
10921100
commandsInProgress.decrementAndGet();

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,16 @@ public Property<Integer> getWorkers() {
818818
*/
819819
public static final Property<Integer> SSL_HANDSHAKE_TIMEOUT = new Property<>("ssl.handshake.timeout", 30, Integer.class);
820820

821+
/**
822+
* Timeout (in seconds) to wait for the incremental snapshot to complete.
823+
* */
824+
public static final Property<Integer> INCREMENTAL_SNAPSHOT_TIMEOUT = new Property<>("incremental.snapshot.timeout", 10800);
825+
826+
/**
827+
* Timeout (in seconds) to wait for the snapshot reversion to complete.
828+
* */
829+
public static final Property<Integer> REVERT_SNAPSHOT_TIMEOUT = new Property<>("revert.snapshot.timeout", 10800);
830+
821831
public static class Property <T>{
822832
private String name;
823833
private T defaultValue;

api/src/main/java/com/cloud/agent/api/Command.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,31 @@ public static enum OnError {
3535
Continue, Stop
3636
}
3737

38+
public enum State {
39+
CREATED, // Command is created by management server
40+
STARTED, // Command is started by agent
41+
PROCESSING, // Processing by agent
42+
PROCESSING_IN_BACKEND, // Processing in backend by agent
43+
COMPLETED, // Operation succeeds by agent or management server
44+
FAILED, // Operation fails by agent
45+
RECONCILE_RETRY, // Ready for retry of reconciliation
46+
RECONCILING, // Being reconciled by management server
47+
RECONCILED, // Reconciled by management server
48+
RECONCILE_SKIPPED, // Skip the reconciliation as the resource state is inconsistent with the command
49+
RECONCILE_FAILED, // Fail to reconcile by management server
50+
TIMED_OUT, // Timed out on management server or agent
51+
INTERRUPTED, // Interrupted by management server or agent (for example agent is restarted),
52+
DANGLED_IN_BACKEND // Backend process which cannot be processed normally (for example agent is restarted)
53+
}
54+
3855
public static final String HYPERVISOR_TYPE = "hypervisorType";
3956

4057
// allow command to carry over hypervisor or other environment related context info
4158
@LogLevel(Log4jLevel.Trace)
4259
protected Map<String, String> contextMap = new HashMap<String, String>();
4360
private int wait; //in second
4461
private boolean bypassHostMaintenance = false;
62+
private transient long requestSequence = 0L;
4563

4664
protected Command() {
4765
this.wait = 0;
@@ -82,6 +100,10 @@ public String getContextParam(String name) {
82100
return contextMap.get(name);
83101
}
84102

103+
public Map<String, String> getContextMap() {
104+
return contextMap;
105+
}
106+
85107
public boolean allowCaching() {
86108
return true;
87109
}
@@ -94,6 +116,18 @@ public void setBypassHostMaintenance(boolean bypassHostMaintenance) {
94116
this.bypassHostMaintenance = bypassHostMaintenance;
95117
}
96118

119+
public boolean isReconcile() {
120+
return false;
121+
}
122+
123+
public long getRequestSequence() {
124+
return requestSequence;
125+
}
126+
127+
public void setRequestSequence(long requestSequence) {
128+
this.requestSequence = requestSequence;
129+
}
130+
97131
@Override
98132
public boolean equals(Object o) {
99133
if (this == o) return true;

api/src/main/java/com/cloud/agent/api/to/DiskTO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class DiskTO {
4646
private Long diskSeq;
4747
private String path;
4848
private Volume.Type type;
49-
private Map<String, String> _details;
49+
private Map<String, String> details;
5050

5151
public DiskTO() {
5252

@@ -92,10 +92,10 @@ public void setType(Volume.Type type) {
9292
}
9393

9494
public void setDetails(Map<String, String> details) {
95-
_details = details;
95+
this.details = details;
9696
}
9797

9898
public Map<String, String> getDetails() {
99-
return _details;
99+
return details;
100100
}
101101
}

api/src/main/java/com/cloud/agent/api/to/NetworkTO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class NetworkTO {
3636
protected TrafficType type;
3737
protected URI broadcastUri;
3838
protected URI isolationUri;
39-
protected boolean isSecurityGroupEnabled;
39+
protected boolean securityGroupEnabled;
4040
protected String name;
4141
protected String ip6address;
4242
protected String ip6gateway;
@@ -112,7 +112,7 @@ public String getName() {
112112
}
113113

114114
public void setSecurityGroupEnabled(boolean enabled) {
115-
this.isSecurityGroupEnabled = enabled;
115+
this.securityGroupEnabled = enabled;
116116
}
117117

118118
/**
@@ -221,7 +221,7 @@ public void setIsolationuri(URI isolationUri) {
221221
}
222222

223223
public boolean isSecurityGroupEnabled() {
224-
return this.isSecurityGroupEnabled;
224+
return this.securityGroupEnabled;
225225
}
226226

227227
public void setIp6Dns1(String ip6Dns1) {

0 commit comments

Comments
 (0)