File tree Expand file tree Collapse file tree
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434import org .apache .iotdb .db .queryengine .common .FragmentInstanceId ;
3535import org .apache .iotdb .db .queryengine .common .QueryId ;
3636import org .apache .iotdb .db .queryengine .common .SessionInfo ;
37+ import org .apache .iotdb .db .queryengine .exception .MemoryNotEnoughException ;
3738import org .apache .iotdb .db .queryengine .metric .DriverSchedulerMetricSet ;
3839import org .apache .iotdb .db .queryengine .metric .QueryRelatedResourceMetricSet ;
3940import org .apache .iotdb .db .queryengine .metric .QueryResourceMetricSet ;
@@ -959,9 +960,22 @@ private void releaseTVListOwnedByQuery() {
959960 memoryReservationManager .releaseMemoryVirtually (tvList .getReservedMemoryBytes ());
960961 FragmentInstanceContext queryContext =
961962 (FragmentInstanceContext ) queryContextSet .iterator ().next ();
962- queryContext
963- .getMemoryReservationContext ()
964- .reserveMemoryVirtually (releasedBytes .left , releasedBytes .right );
963+ try {
964+ queryContext
965+ .getMemoryReservationContext ()
966+ .reserveMemoryVirtually (releasedBytes .left , releasedBytes .right );
967+ } catch (MemoryNotEnoughException ex ) {
968+ LOGGER .warn (
969+ "MemoryNotEnoughException when transferring TVList ownership from query {} to another query {}." ,
970+ this .getId (),
971+ queryContext .getId ());
972+ } catch (RuntimeException ex ) {
973+ LOGGER .warn (
974+ "Unexpected Exception when transferring TVList ownership from query {} to another query {}." ,
975+ this .getId (),
976+ queryContext .getId (),
977+ ex );
978+ }
965979
966980 if (LOGGER .isDebugEnabled ()) {
967981 LOGGER .debug (
You can’t perform that action at this time.
0 commit comments